summaryrefslogtreecommitdiff
path: root/sqlparse
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2010-06-17 20:21:44 +0200
committerAndi Albrecht <albrecht.andi@gmail.com>2010-06-17 20:21:44 +0200
commitb737d2093eacf3c34e1eb413192f86f0d8623ecd (patch)
tree94a4c346e3e92c0bb05dce06a209fdc249c1a9ee /sqlparse
parent521a87c900a19e39f9e508c898cb191acfc75199 (diff)
downloadsqlparse-b737d2093eacf3c34e1eb413192f86f0d8623ecd.tar.gz
Improve detection of escaped single quotes (fixes issue13, reported by Martin Brochhaus, patch by bluemaro with test case by Dan Carley).
Diffstat (limited to 'sqlparse')
-rw-r--r--sqlparse/lexer.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py
index a416c16..b7b16af 100644
--- a/sqlparse/lexer.py
+++ b/sqlparse/lexer.py
@@ -175,8 +175,8 @@ class Lexer:
(r'[+/@#%^&|`?^-]+', Operator),
(r'[0-9]+', Number.Integer),
# TODO: Backslash escapes?
- (r"'(''|[^'])*'", String.Single),
- (r'"(""|[^"])*"', String.Symbol), # not a real string literal in ANSI SQL
+ (r"(''|'.*?[^\\]')", String.Single),
+ (r'(""|".*?[^\\]")', String.Symbol), # not a real string literal in ANSI SQL
(r'(LEFT |RIGHT )?(INNER |OUTER )?JOIN\b', Keyword),
(r'END( IF| LOOP)?\b', Keyword),
(r'CREATE( OR REPLACE)?\b', Keyword.DDL),