server/sources/rql2sql.py
branchstable
changeset 8245 d53762ae5961
parent 8238 087bb529035c
child 8457 69ad9a509bc3
equal deleted inserted replaced
8243:b1243a329b5d 8245:d53762ae5961
  1452     def visit_mathexpression(self, mexpr):
  1452     def visit_mathexpression(self, mexpr):
  1453         """generate SQL for a mathematic expression"""
  1453         """generate SQL for a mathematic expression"""
  1454         lhs, rhs = mexpr.get_parts()
  1454         lhs, rhs = mexpr.get_parts()
  1455         # check for string concatenation
  1455         # check for string concatenation
  1456         operator = mexpr.operator
  1456         operator = mexpr.operator
       
  1457         if operator == '%':
       
  1458             operator = '%%'
  1457         try:
  1459         try:
  1458             if mexpr.operator == '+' and mexpr.get_type(self._state.solution, self._args) == 'String':
  1460             if mexpr.operator == '+' and mexpr.get_type(self._state.solution, self._args) == 'String':
  1459                 return '(%s)' % self.dbhelper.sql_concat_string(lhs.accept(self),
  1461                 return '(%s)' % self.dbhelper.sql_concat_string(lhs.accept(self),
  1460                                                                 rhs.accept(self))
  1462                                                                 rhs.accept(self))
  1461         except CoercionError:
  1463         except CoercionError: