Re: After kill query, mysql_stmt_close() hangs for prepared stmt
Posted by: Sebastien FLAESCH
Date: June 29, 2022 12:54AM

Hello,

The issue is not about performing the KILL QUERY command.

My issue is at the MySQL C interface level, in libmysqlclient.so, or with the client/server protocol.

No matter how the current running SQL statement was killed (by same process opening a new connection like mysql command interpreter does, or when KILL QUERY is executed by another SQL process/connection), the issue occurs when using mysql_stmt_prepare() / mysql_stmt_bind_param() / mysql_stmt_execute():

For a long SELECT or when an UPDATE/DELETE is waiting for a lock to be released, if that query gets killed, then libmysqlclient.so seems to be confused because some C/S protocol sequence/state is wrong.

A subsequent mysql_stmt_close() hands, making the MYSQL_STMT handle unusable.

Even if I skip mysql_stmt_close() (and leave the MYSQL_STMT aside), when the try to continue by creating a new MYSQL_STMT / mysql_stmt_prepare(), I get errors and can't continue with the current SQL connection.

Seb

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: After kill query, mysql_stmt_close() hangs for prepared stmt
165
June 29, 2022 12:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.