diff options
| author | Andi Albrecht <albrecht.andi@gmail.com> | 2013-06-17 12:12:40 -0700 |
|---|---|---|
| committer | Andi Albrecht <albrecht.andi@gmail.com> | 2013-06-17 12:12:40 -0700 |
| commit | 14ca59da81146014657ded3019c9680e58ea17e4 (patch) | |
| tree | e3f29b658a7f4766f0cfd96ea33fc90ad00d4944 | |
| parent | 91a9efe0511ab5b1c769d90c04b8b329fe3173ad (diff) | |
| parent | 7d0fb12663479da1dd8b1d9a2ee97527c6c51863 (diff) | |
| download | sqlparse-14ca59da81146014657ded3019c9680e58ea17e4.tar.gz | |
Merge pull request #100 from rnix/patch-1
Stop parsing tables at first keyword after "from".
| -rw-r--r-- | examples/extract_table_names.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/extract_table_names.py b/examples/extract_table_names.py index b153850..dbe83f9 100644 --- a/examples/extract_table_names.py +++ b/examples/extract_table_names.py @@ -24,7 +24,9 @@ def is_subselect(parsed): def extract_from_part(parsed): from_seen = False for item in parsed.tokens: - if from_seen: + if item.ttype is Keyword: + from_seen = False + elif from_seen: if is_subselect(item): for x in extract_from_part(item): yield x |
