I want to interrupt a long running statement with CTRL-C
I am using the same technique as the mysql.cc 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 mysql.cc 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:
https://bugs.mysql.com/bug.php?id=84470&error=nd
But I see not much activity on that...
Seb