Patch for an Issue #362 (more work required)

This commit is contained in:
Miroslav Stampar 2013-01-20 22:16:34 +01:00
parent b4a55a809e
commit a7028af2e9
2 changed files with 14 additions and 10 deletions

View File

@ -15,9 +15,11 @@ class Syntax(GenericSyntax):
@staticmethod @staticmethod
def escape(expression, quote=True): def escape(expression, quote=True):
def escaper(value): def escaper(value):
retVal = value return "||".join("ASCII_CHAR(%d)" % ord(_) for _ in value)
if isDBMSVersionAtLeast('2.1'):
retVal = "||".join("ASCII_CHAR(%d)" % ord(_) for _ in value)
return retVal
return Syntax._escape(expression, quote, escaper) retVal = expression
if isDBMSVersionAtLeast('2.1'):
retVal = Syntax._escape(expression, quote, escaper)
return retVal

View File

@ -17,9 +17,11 @@ class Syntax(GenericSyntax):
@staticmethod @staticmethod
def escape(expression, quote=True): def escape(expression, quote=True):
def escaper(value): def escaper(value):
retVal = value return "X'%s'" % binascii.hexlify(value)
if isDBMSVersionAtLeast('3'):
retVal = "X'%s'" % binascii.hexlify(value)
return retVal
return Syntax._escape(expression, quote, escaper) retVal = expression
if isDBMSVersionAtLeast('3'):
retVal = Syntax._escape(expression, quote, escaper)
return retVal