diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-14 14:44:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-01-14 14:44:33 +0000 |
commit | 2d358ab3d8f978730beb0600b3957ef4ba599bd3 (patch) | |
tree | cb8b30d2acb2e34d7a0605f07bd94972d392162d /mycli/packages/parseutils.py | |
parent | Adding upstream version 1.24.1. (diff) | |
download | mycli-2d358ab3d8f978730beb0600b3957ef4ba599bd3.tar.xz mycli-2d358ab3d8f978730beb0600b3957ef4ba599bd3.zip |
Adding upstream version 1.24.2.upstream/1.24.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mycli/packages/parseutils.py')
-rw-r--r-- | mycli/packages/parseutils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mycli/packages/parseutils.py b/mycli/packages/parseutils.py index fa5f2c9..d47f59a 100644 --- a/mycli/packages/parseutils.py +++ b/mycli/packages/parseutils.py @@ -81,6 +81,13 @@ def extract_from_part(parsed, stop_at_punctuation=True): yield x elif stop_at_punctuation and item.ttype is Punctuation: return + # Multiple JOINs in the same query won't work properly since + # "ON" is a keyword and will trigger the next elif condition. + # So instead of stooping the loop when finding an "ON" skip it + # eg: 'SELECT * FROM abc JOIN def ON abc.id = def.abc_id JOIN ghi' + elif item.ttype is Keyword and item.value.upper() == 'ON': + tbl_prefix_seen = False + continue # An incomplete nested select won't be recognized correctly as a # sub-select. eg: 'SELECT * FROM (SELECT id FROM user'. This causes # the second FROM to trigger this elif condition resulting in a |