vscode-database-client icon indicating copy to clipboard operation
vscode-database-client copied to clipboard

[BUG] After the query is stopped, it is still executed on the server.

Open sousagaspar opened this issue 3 years ago • 2 comments

  • OS:Ubuntu 20.04
  • Database Type:MySQL 5.7

When you run SQL statements that take a long time to execute, one can cancel the execution by pressing the "power off" button image Although in the UI the execution of the statement was apparently stopped the execution is still alive in the database. One can check it by executing:

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = '<your_username_here>' ORDER BY TIME DESC;

It would make sense that this poweroff button, could retrieve the ID of the statement that is being stopped and kill it, i.e. by executing KILL <ID> where the ID is got from the PROCESSLIST table.

sousagaspar avatar Sep 01 '22 10:09 sousagaspar

Thanks for your feedback, but the client cannot cancel the executing SQL.

cweijan avatar Sep 01 '22 15:09 cweijan

Thank you for your feedback!

On Thu, Sep 1, 2022, 16:32 Weijan Chen @.***> wrote:

Thanks for your feedback, I will fix it in the next version.

— Reply to this email directly, view it on GitHub https://github.com/cweijan/vscode-database-client/issues/674#issuecomment-1234445624, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIXCECOTZGZKGBJODELU7DDV4DD7PANCNFSM6AAAAAAQCHGI4A . You are receiving this because you authored the thread.Message ID: @.***>

sousagaspar avatar Sep 01 '22 20:09 sousagaspar

@cweijan, I believe that client can do this. If the trash icon is clicked, under the woods it would execute:

  1. SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = '<user_name>' AND INFO = '<sql_statement_to_close>';
  2. KILL id ; //got from previous statement

sousagaspar avatar Oct 25 '22 13:10 sousagaspar

Yes, but needs to create a new connection to close when the stop button is clicked, I will try to implement it in the future.

cweijan avatar Oct 25 '22 13:10 cweijan

I released the 5.9.3 version, and now it can correctly close the executing mysql connection.

cweijan avatar Nov 29 '22 12:11 cweijan