[oracle] ORA-01425: escape character must be character string of length 1
|Reported by:||frank.hoffsummer@…||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In order to update my project to a later version of trunk, I recreated all tables in my DB (dropped all tables and sequences, and then performed a syncdb with the newer django version)
My Database is an Oracle 9i.
Strangely enough, now I get 500 server errors executing some of my views (that worked fine previously).
The problem is always:
ORA-01425: escape character must be character string of length 1
I know, this sounds related to ticket 5558, but it isnt
I looked in the debug view, which query is executed when the problem arises, and it looks as follows:
args [':arg0', ':arg1', ':arg2'] i 2 params ('2007-10-21 00:00:00', '2007-11-19 16:08:17.025442', 'webb%') query u'SELECT COUNT(*) FROM "LOG_JOBSTATUS" INNER JOIN "CONFIG_CHANNEL" "LOG_JOBSTATUS__CHANNEL" ON "LOG_JOBSTATUS"."CHANNEL_ID" = "LOG_JOBSTATUS__CHANNEL"."ID" WHERE ("LOG_JOBSTATUS"."STARTED" BETWEEN :arg0 AND :arg1 AND UPPER("LOG_JOBSTATUS__CHANNEL"."NAME") LIKE UPPER(:arg2) ESCAPE \'\\\')' self <django.db.backends.oracle.base.FormatStylePlaceholderCursor on <cx_Oracle.Connection to mcca@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=arnd.svt.se)(PORT=1522)))(CONNECT_DATA=(SID=matd)))>>
Oracle's problem seems to be the ESCAPE \'
\' at the end of the sql query string.
I looked at oracle/base.py and saw that the original string is ESCAPE '
' . Looks like a bug in the escape handling to me (i.e. the quotes are escaped before the escaped backslash is un-escaped). Or something like that....
Change History (17)
comment:1 Changed 7 years ago by anonymous
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:3 Changed 7 years ago by anonymous
- Keywords oracle added; ORACLE removed
- Summary changed from ORA-01425: escape character must be character string of length 1 to [oracle] ORA-01425: escape character must be character string of length 1