Skip to content

Commit fd85202

Browse files
committed
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.
1 parent 151631b commit fd85202

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎client/mysql.cc‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4491,6 +4491,8 @@ print_tab_data(MYSQL_RES *result)
44914491
}
44924492
while ((cur = mysql_fetch_row(result)))
44934493
{
4494+
if (interrupted_query)
4495+
break;
44944496
lengths=mysql_fetch_lengths(result);
44954497
field= mysql_fetch_fields(result);
44964498
if (opt_binhex && is_binary_field(&field[0]))

0 commit comments

Comments
 (0)