Define explicitly escape char used for like operators

For now we rely on the default value set by python-sql but SQL-92 does not
define a default value.

Closes #12933
(grafted from 659160cd1681a6a1bc98d51a97d7765ee8d31714)

--HG--
branch : 7.0
This commit is contained in:
Cédric Krier committed 2024-01-14 13:32:27 +01:00
1 parent 535e207116
commit 3bef7eff33
1 file changed
+5 -5
+5 -5
View File
@@ -1,7 +1,7 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import warnings
from functools import wraps
from functools import partial, wraps
import sql
from sql import (
@@ -234,10 +234,10 @@ def order_method(func):
SQL_OPERATORS = {
'=': operators.Equal,
'!=': operators.NotEqual,
'like': operators.Like,
'not like': operators.NotLike,
'ilike': operators.ILike,
'not ilike': operators.NotILike,
'like': partial(operators.Like, escape='\\'),
'not like': partial(operators.NotLike, escape='\\'),
'ilike': partial(operators.ILike, escape='\\'),
'not ilike': partial(operators.NotILike, escape='\\'),
'in': operators.In,
'not in': operators.NotIn,
'<=': operators.LessEqual,