﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
5985	[oracle] ORA-01425: escape character must be character string of length 1	frank.hoffsummer@…	nobody	"Hello,
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....


"		closed	Database layer (models, ORM)	dev		fixed	oracle	Erin Kelly	Unreviewed	0	0	0	0	0	0
