Fixed #20785 -- Corrected exception caught for Oracle LIKE operator detection
The code that tests to see which LIKE expressions to use now runs using non-error-wrapped cursor, so cx_Oracle exceptions need to be caught rather than Django DatabaseErrors. Thanks Trac user ludo for report and initial patch.
This commit is contained in:
parent
05ea5a2139
commit
6ed579e7eb
|
@ -578,7 +578,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
||||||
cursor.execute("SELECT 1 FROM DUAL WHERE DUMMY %s"
|
cursor.execute("SELECT 1 FROM DUAL WHERE DUMMY %s"
|
||||||
% self._standard_operators['contains'],
|
% self._standard_operators['contains'],
|
||||||
['X'])
|
['X'])
|
||||||
except utils.DatabaseError:
|
except DatabaseError:
|
||||||
self.operators = self._likec_operators
|
self.operators = self._likec_operators
|
||||||
else:
|
else:
|
||||||
self.operators = self._standard_operators
|
self.operators = self._standard_operators
|
||||||
|
|
Loading…
Reference in New Issue