diff options
author | Gavin Wahl <gwahl@fusionbox.com> | 2014-08-07 14:12:46 -0600 |
---|---|---|
committer | Gavin Wahl <gwahl@fusionbox.com> | 2014-08-07 14:12:46 -0600 |
commit | 8ffe95af292e0930b7126aae1905a97f7ebdfb24 (patch) | |
tree | e2ada6890d9120d84a353614aadd333412cf450e /sqlparse/lexer.py | |
parent | 8f5f638b1a0c0759adf122450f9027f47a4a220e (diff) | |
download | sqlparse-8ffe95af292e0930b7126aae1905a97f7ebdfb24.tar.gz |
Handle modulo operator without spaces
`x %3` should be interpreted as a modulo operation, not a parameter
marker.
Co-authored-by: Rocky Meza <rmeza@fusionbox.com>
Diffstat (limited to 'sqlparse/lexer.py')
-rw-r--r-- | sqlparse/lexer.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index 0d915ac..6bd414f 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -180,7 +180,8 @@ class Lexer(object): (r'\$([^\W\d]\w*)?\$', tokens.Name.Builtin), (r'\?{1}', tokens.Name.Placeholder), (r'%\(\w+\)s', tokens.Name.Placeholder), - (r'[$:?%]\w+', tokens.Name.Placeholder), + (r'%s', tokens.Name.Placeholder), + (r'[$:?]\w+', tokens.Name.Placeholder), # FIXME(andi): VALUES shouldn't be listed here # see https://github.com/andialbrecht/sqlparse/pull/64 (r'VALUES', tokens.Keyword), |