diff options
author | Sebastian Janko <janko.sebastian@gmail.com> | 2019-07-13 02:24:39 +0200 |
---|---|---|
committer | Irina Truong <i.chernyavska@gmail.com> | 2019-07-12 17:24:39 -0700 |
commit | f85642da67285a2b1d991d1d0970d261a715efb1 (patch) | |
tree | 050dffc3887ca2856f7b9fbcb55a761e88578b3f /pgcli | |
parent | 10cc4ce2b9e1d745f3be91373f48ef6ea9ca7f88 (diff) |
Issue 1019 stacktrace on empty query (#1078)
* Added changes to skip empty queries
Empty queries consist of one or more semicolons
* Reformatted with black
* Added contribution to changelog and name to AUTHORS
* Black.
Diffstat (limited to 'pgcli')
-rw-r--r-- | pgcli/main.py | 2 | ||||
-rw-r--r-- | pgcli/pgexecute.py | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/pgcli/main.py b/pgcli/main.py index fdbbc15c..27ca09b7 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -859,6 +859,8 @@ class PGCli(object): text, self.pgspecial, exception_formatter, on_error_resume ) + is_special = None + for title, cur, headers, status, sql, success, is_special in res: logger.debug("headers: %r", headers) logger.debug("rows: %r", cur) diff --git a/pgcli/pgexecute.py b/pgcli/pgexecute.py index b3ebb5c0..9e6c4b7c 100644 --- a/pgcli/pgexecute.py +++ b/pgcli/pgexecute.py @@ -376,6 +376,8 @@ class PGExecute(object): for sql in sqlparse.split(statement): # Remove spaces, eol and semi-colons. sql = sql.rstrip(";") + if not sql: + continue try: if pgspecial: |