server/sources/rql2sql.py
changeset 7257 beea955b45e2
parent 7256 ccd44caeb936
child 7359 40490b9e0a6e
equal deleted inserted replaced
7256:ccd44caeb936 7257:beea955b45e2
  1355         if operator in ('LIKE', 'ILIKE'):
  1355         if operator in ('LIKE', 'ILIKE'):
  1356             if operator == 'ILIKE' and not self.dbhelper.ilike_support:
  1356             if operator == 'ILIKE' and not self.dbhelper.ilike_support:
  1357                 operator = ' LIKE '
  1357                 operator = ' LIKE '
  1358             else:
  1358             else:
  1359                 operator = ' %s ' % operator
  1359                 operator = ' %s ' % operator
       
  1360         elif operator == 'REGEXP':
       
  1361             return ' %s' % self.dbhelper.sql_regexp_match_expression(rhs.accept(self))
  1360         elif (operator == '=' and isinstance(rhs, Constant)
  1362         elif (operator == '=' and isinstance(rhs, Constant)
  1361               and rhs.eval(self._args) is None):
  1363               and rhs.eval(self._args) is None):
  1362             if lhs is None:
  1364             if lhs is None:
  1363                 return ' IS NULL'
  1365                 return ' IS NULL'
  1364             return '%s IS NULL' % lhs.accept(self)
  1366             return '%s IS NULL' % lhs.accept(self)