Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mycli output (0, '') when the last query is cancelled #1140

Open
cosven opened this issue Nov 20, 2023 · 0 comments
Open

mycli output (0, '') when the last query is cancelled #1140

cosven opened this issue Nov 20, 2023 · 0 comments

Comments

@cosven
Copy link

cosven commented Nov 20, 2023

I run a query show backends and it run for several seconds, then I cancel the query using 'ctrl-c'.
I run some other query later, and mycli always output

(0, '')

image

mycli version: 8c005f7 ( I also met this problem in the latest release)

I checked mycli.log and found an exception

Traceback (most recent call last):
  File "/Users/cosven/code/mycli/mycli/sqlexecute.py", line 248, in run
    for result in special.execute(cur, sql):
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/cosven/code/mycli/mycli/packages/special/main.py", line 58, in execute
    raise CommandNotFound
mycli.packages.special.main.CommandNotFound

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cosven/code/mycli/mycli/main.py", line 727, in one_iteration
    for title, cur, headers, status in res:
  File "/Users/cosven/code/mycli/mycli/sqlexecute.py", line 252, in run
    cur.execute(sql)
  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/cursors.py", line 153, in execute
    result = self._query(query)
             ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/cursors.py", line 322, in _query
    conn.query(q)
  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/connections.py", line 557, in query
    self._execute_command(COMMAND.COM_QUERY, sql)
  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/connections.py", line 840, in _execute_command
    raise err.InterfaceError(0, "")
pymysql.err.InterfaceError: (0, '')

mycli.log

2023-11-16 10:43:25,384 (27740/completion_refresh) mycli.sqlexecute ERROR - No user completions due to OperationalError(1105, "errCode = 2, detailMessage = Unknown table 'user'")
2023-11-16 10:43:25,582 (27740/completion_refresh) mycli.sqlexecute ERROR - No show completions due to OperationalError(1105, "errCode = 2, detailMessage = Unknown table 'help_topic'")
2023-11-16 15:48:40,769 (50597/completion_refresh) mycli.sqlexecute ERROR - No user completions due to OperationalError(1105, "errCode = 2, detailMessage = Unknown table 'user'")
2023-11-16 15:48:40,956 (50597/completion_refresh) mycli.sqlexecute ERROR - No show completions due to OperationalError(1105, "errCode = 2, detailMessage = Unknown table 'help_topic'")
2023-11-16 15:48:45,183 (50597/completion_refresh) mycli.sqlexecute ERROR - No user completions due to OperationalError(1105, "errCode = 2, detailMessage = Unknown table 'user'")
2023-11-16 15:48:45,400 (50597/completion_refresh) mycli.sqlexecute ERROR - No show completions due to OperationalError(1105, "errCode = 2, detailMessage = Unknown table 'help_topic'")
2023-11-16 16:26:01,638 (50597/MainThread) mycli.main ERROR - sql: 'show backends;', error: InterfaceError(0, '')
2023-11-16 16:26:01,640 (50597/MainThread) mycli.main ERROR - traceback: 'Traceback (most recent call last):\n  File "/Users/cosven/code/mycli/mycli/sqlexecute.py", line 248, in run\n    for result in special.execute(cur, sql):\n                  ^^^^^^^^^^^^^^^^^^^^^^^^^\n  File "/Users/cosven/code/mycli/mycli/packages/special/main.py", line 58, in execute\n    raise CommandNotFound\nmycli.packages.special.main.CommandNotFound\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n  File "/Users/cosven/code/mycli/mycli/main.py", line 727, in one_iteration\n    for title, cur, headers, status in res:\n  File "/Users/cosven/code/mycli/mycli/sqlexecute.py", line 252, in run\n    cur.execute(sql)\n  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/cursors.py", line 153, in execute\n    result = self._query(query)\n             ^^^^^^^^^^^^^^^^^^\n  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/cursors.py", line 322, in _query\n    conn.query(q)\n  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/connections.py", line 557, in query\n    self._execute_command(COMMAND.COM_QUERY, sql)\n  File "/opt/homebrew/lib/python3.11/site-packages/pymysql/connections.py", line 840, in _execute_command\n    raise err.InterfaceError(0, "")\npymysql.err.InterfaceError: (0, \'\')\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant