equal
deleted
inserted
replaced
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: |