diff --git a/plugins/dbms/oracle/syntax.py b/plugins/dbms/oracle/syntax.py index 6e80c9e37..e4087e517 100644 --- a/plugins/dbms/oracle/syntax.py +++ b/plugins/dbms/oracle/syntax.py @@ -30,15 +30,8 @@ class Syntax(GenericSyntax): lastIndex = firstIndex + index old = "'%s'" % expression[firstIndex:lastIndex] - #unescaped = "(" - unescaped = "" + unescaped = "||".join("%s(%d)" % ("CHR" if ord(expression[i]) < 256 else "NCHR", ord(expression[i])) for i in xrange(firstIndex, lastIndex)) - for i in xrange(firstIndex, lastIndex): - unescaped += "%s(%d)" % ("CHR" if ord(expression[i]) < 256 else "NCHR", ord(expression[i])) - if i < lastIndex - 1: - unescaped += "||" - - #unescaped += ")" expression = expression.replace(old, unescaped) else: expression = "||".join("CHR(%d)" % ord(c) for c in expression) diff --git a/plugins/dbms/postgresql/syntax.py b/plugins/dbms/postgresql/syntax.py index 902300f18..1f75f9d87 100644 --- a/plugins/dbms/postgresql/syntax.py +++ b/plugins/dbms/postgresql/syntax.py @@ -30,16 +30,8 @@ class Syntax(GenericSyntax): lastIndex = firstIndex + index old = "'%s'" % expression[firstIndex:lastIndex] - #unescaped = "(" - unescaped = "" + unescaped = "||".join("CHR(%d)" % (ord(expression[i])) for i in xrange(firstIndex, lastIndex)) # Postgres CHR() function already accepts Unicode code point of character(s) - for i in xrange(firstIndex, lastIndex): - # Postgres CHR() function already accepts Unicode code point of character(s) - unescaped += "CHR(%d)" % (ord(expression[i])) - if i < lastIndex - 1: - unescaped += "||" - - #unescaped += ")" expression = expression.replace(old, unescaped) else: expression = "||".join("CHR(%d)" % ord(c) for c in expression) diff --git a/plugins/dbms/sybase/syntax.py b/plugins/dbms/sybase/syntax.py index 5c9d3a517..d9e3c18b2 100644 --- a/plugins/dbms/sybase/syntax.py +++ b/plugins/dbms/sybase/syntax.py @@ -30,14 +30,8 @@ class Syntax(GenericSyntax): lastIndex = firstIndex + index old = "'%s'" % expression[firstIndex:lastIndex] - unescaped = "" + unescaped = "+".join("%s(%d)" % ("CHAR" if ord(expression[i]) < 256 else "TO_UNICHAR", ord(expression[i])) for i in xrange(firstIndex, lastIndex)) - for i in xrange(firstIndex, lastIndex): - unescaped += "%s(%d)" % ("CHAR" if ord(expression[i]) < 256 else "TO_UNICHAR", ord(expression[i])) - if i < lastIndex - 1: - unescaped += "+" - - #unescaped += ")" expression = expression.replace(old, unescaped) else: expression = "+".join("CHAR(%d)" % ord(c) for c in expression)