Add missing sql_format in "like" clauses

issue2478
review270002
(transplanted from 0fe90cd57f000b9382d9859f47bfea0d62c8e23c)
This commit is contained in:
Cédric Krier committed 2012-03-05 11:45:51 +01:00
1 parent 107f4167d1
commit 982a95be2f
1 file changed
+6 -2
+6 -2
View File
@@ -1822,12 +1822,16 @@ class ModelSQL(ModelStorage):
qu2.append('%')
add_null = True
else:
qu2.append(arg[2])
qu2.append(FIELDS[
table._columns[arg[0]]._type
].sql_format(arg[2]))
elif arg[1] in ('not like', 'not ilike'):
if not arg[2]:
qu2.append('')
else:
qu2.append(arg[2])
qu2.append(FIELDS[
table._columns[arg[0]]._type
].sql_format(arg[2]))
add_null = True
else:
if arg[0] in table._columns: