Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 604694c commit 5b6c01dCopy full SHA for 5b6c01d
1 file changed
plugins/dbms/hsql/syntax.py
@@ -16,18 +16,6 @@ def __init__(self):
16
17
@staticmethod
18
def escape(expression, quote=True):
19
- """
20
- TODO: Unsure of a method to escape. Perhaps RAWTOHEX/HEXTORAW functions?
21
- >>> Syntax.escape("SELECT 'abcdefgh' FROM foobar")
22
- 'SELECT 'abcdefgh' FROM foobar'
23
24
-
25
def escaper(value):
26
- retVal = None
27
- try:
28
- retVal = "'%s'" % value
29
- except UnicodeEncodeError:
30
- retVal = "CONVERT(0x%s USING utf8)" % "".join("%.2x" % ord(_) for _ in utf8encode(value))
+ retVal = "||".join("CHAR(%d)" % ord(value[i]) for i in xrange(len(value)))
31
return retVal
32
33
- return Syntax._escape(expression, quote, escaper)
0 commit comments