1
0
mirror of https://github.com/MariaDB/server.git synced 2026-10-23 18:49:29 +03:00

MDEV-41150 mariadb client: Ctrl-C does not interrupt tab separated result output

Ctrl-C sets interrupted_query and sends KILL QUERY to the server, but the
result is already fetched into the client by then, so killing the query
cannot stop the output. Only the printing loop can, by checking
interrupted_query.

print_table_data(), print_table_data_html(), print_table_data_xml() and
print_table_data_vertically() check it, print_tab_data() did not, so the
output of -s, -N and -B could not be interrupted.

Add the same check to print_tab_data().

No test case: the suite drives the client through a pty with socat, where
0x03 is not turned into a signal, and there is no other way in the suite to
signal a client while it is printing.
This commit is contained in:
Khaled Riyad
2026-09-18 15:49:36 +03:00
parent 151631b8cf
commit 4361d6acbe

View File

@@ -4491,6 +4491,8 @@ print_tab_data(MYSQL_RES *result)
}
while ((cur = mysql_fetch_row(result)))
{
if (interrupted_query)
break;
lengths=mysql_fetch_lengths(result);
field= mysql_fetch_fields(result);
if (opt_binhex && is_binary_field(&field[0]))