Skip to content

Commit

Permalink
Merge pull request #778 from pasenor/rename-table-reload-completions
Browse files Browse the repository at this point in the history
added RENAME TABLE to the lists of mutating and destructive queries
  • Loading branch information
amjith authored Oct 3, 2019
2 parents 99d5cb7 + 8ac245d commit 8168cc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mycli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ def one_iteration(text=None):

start = time()
result_count += 1
mutating = mutating or is_mutating(status)
mutating = mutating or destroy or is_mutating(status)
special.unset_once_if_written()
except EOFError as e:
raise e
Expand Down Expand Up @@ -1208,7 +1208,7 @@ def need_completion_refresh(queries):
try:
first_token = query.split()[0]
if first_token.lower() in ('alter', 'create', 'use', '\\r',
'\\u', 'connect', 'drop'):
'\\u', 'connect', 'drop', 'rename'):
return True
except Exception:
return False
Expand Down Expand Up @@ -1257,7 +1257,7 @@ def is_mutating(status):
return False

mutating = set(['insert', 'update', 'delete', 'alter', 'create', 'drop',
'replace', 'truncate', 'load'])
'replace', 'truncate', 'load', 'rename'])
return status.split(None, 1)[0].lower() in mutating

def is_select(status):
Expand Down

0 comments on commit 8168cc6

Please sign in to comment.