From a7028af2e99f7d964c84dd4d2cb482b7bc117cdf Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 20 Jan 2013 22:16:34 +0100 Subject: [PATCH] Patch for an Issue #362 (more work required) --- plugins/dbms/firebird/syntax.py | 12 +++++++----- plugins/dbms/sqlite/syntax.py | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/plugins/dbms/firebird/syntax.py b/plugins/dbms/firebird/syntax.py index 1722c3d8f..97d515f83 100644 --- a/plugins/dbms/firebird/syntax.py +++ b/plugins/dbms/firebird/syntax.py @@ -15,9 +15,11 @@ class Syntax(GenericSyntax): @staticmethod def escape(expression, quote=True): def escaper(value): - retVal = value - if isDBMSVersionAtLeast('2.1'): - retVal = "||".join("ASCII_CHAR(%d)" % ord(_) for _ in value) - return retVal + return "||".join("ASCII_CHAR(%d)" % ord(_) for _ in value) - return Syntax._escape(expression, quote, escaper) + retVal = expression + + if isDBMSVersionAtLeast('2.1'): + retVal = Syntax._escape(expression, quote, escaper) + + return retVal \ No newline at end of file diff --git a/plugins/dbms/sqlite/syntax.py b/plugins/dbms/sqlite/syntax.py index 9ff9ff382..8e43c686a 100644 --- a/plugins/dbms/sqlite/syntax.py +++ b/plugins/dbms/sqlite/syntax.py @@ -17,9 +17,11 @@ class Syntax(GenericSyntax): @staticmethod def escape(expression, quote=True): def escaper(value): - retVal = value - if isDBMSVersionAtLeast('3'): - retVal = "X'%s'" % binascii.hexlify(value) - return retVal + return "X'%s'" % binascii.hexlify(value) - return Syntax._escape(expression, quote, escaper) + retVal = expression + + if isDBMSVersionAtLeast('3'): + retVal = Syntax._escape(expression, quote, escaper) + + return retVal \ No newline at end of file