summaryrefslogtreecommitdiff
path: root/sqlparse/sql.py
diff options
context:
space:
mode:
authorVictor Uriarte <victor.m.uriarte@intel.com>2016-06-10 18:53:15 -0700
committerVictor Uriarte <victor.m.uriarte@intel.com>2016-06-11 04:34:14 -0700
commit0c468f5947741c0583330535e62c361f3a6af5ed (patch)
tree94666a30d05d45c1d2cd505874ef8215bad3f2d3 /sqlparse/sql.py
parentff0ee839987c43c420f1a5d167e3c3c0e873411c (diff)
downloadsqlparse-0c468f5947741c0583330535e62c361f3a6af5ed.tar.gz
Fix get_token_at_offset behavior at edge
At position 6 (with an index starting at 0) it should have been on 2nd word for the example sql='select * from dual'
Diffstat (limited to 'sqlparse/sql.py')
-rw-r--r--sqlparse/sql.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sqlparse/sql.py b/sqlparse/sql.py
index ced18af..a84dbf3 100644
--- a/sqlparse/sql.py
+++ b/sqlparse/sql.py
@@ -167,7 +167,7 @@ class TokenList(Token):
idx = 0
for token in self.flatten():
end = idx + len(token.value)
- if idx <= offset <= end:
+ if idx <= offset < end:
return token
idx = end