mysql_stmt_close() hangs after query interruption
Posted by: Sebastien FLAESCH
Date: March 25, 2020 07:55AM

I want to interrupt a long running statement with CTRL-C

I am using the same technique as the code, by starting a new connect to make a KILL QUERY.

The query is interrupted and control goes back my code, but then a call to mysql_stmt_close() hangs.

The difference with is that my code is using PREPARED STATEMENTS with mysql_stmt_prepare() etc.

This problem appeared in a 5.7.x, same code is working fine with 5.6(.16)
I have tested various versions since 5.7, the problem still occurs with 8.0.18 (I will test 8.0.19)...

Seems that the problem is related to the read-only cursor type option:

unsigned long ct = (unsigned long) CURSOR_TYPE_READ_ONLY;
s = mysql_stmt_attr_set(stmt, STMT_ATTR_CURSOR_TYPE, (const void *) &ct);

Original bug report:

But I see not much activity on that...


Options: ReplyQuote

Written By
mysql_stmt_close() hangs after query interruption
March 25, 2020 07:55AM

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.