diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-08 06:39:52 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-03-08 06:39:52 +0000 |
commit | f96615a770febe0d511ad79d17169aca58095bf2 (patch) | |
tree | 60c586dcee842be1b061221a5fb454a153857585 /mycli/packages/parseutils.py | |
parent | Adding upstream version 1.23.2. (diff) | |
download | mycli-4e7270ba292a91ea55c525ed7b44d92ab240e436.tar.xz mycli-4e7270ba292a91ea55c525ed7b44d92ab240e436.zip |
Adding upstream version 1.24.1.upstream/1.24.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mycli/packages/parseutils.py')
-rw-r--r-- | mycli/packages/parseutils.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/mycli/packages/parseutils.py b/mycli/packages/parseutils.py index 268e04e..fa5f2c9 100644 --- a/mycli/packages/parseutils.py +++ b/mycli/packages/parseutils.py @@ -12,7 +12,8 @@ cleanup_regex = { 'most_punctuations': re.compile(r'([^\.():,\s]+)$'), # This matches everything except a space. 'all_punctuations': re.compile(r'([^\s]+)$'), - } +} + def last_word(text, include='alphanum_underscore'): r""" @@ -226,14 +227,6 @@ def is_destructive(queries): return False -def is_open_quote(sql): - """Returns true if the query contains an unclosed quote.""" - - # parsed can contain one or more semi-colon separated commands - parsed = sqlparse.parse(sql) - return any(_parsed_is_open_quote(p) for p in parsed) - - if __name__ == '__main__': sql = 'select * from (select t. from tabl t' print (extract_tables(sql)) @@ -263,5 +256,4 @@ def is_dropping_database(queries, dbname): ) if database_token is not None and normalize_db_name(database_token.get_name()) == dbname: result = keywords[0].normalized == "DROP" - else: - return result + return result |