summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-10-29 22:10:43 +0300
committerEugene Kosov <claprix@yandex.ru>2019-10-29 22:10:43 +0300
commit9ed4d06706f319c2204c186afe34a899fce315ac (patch)
tree204ff6fc4a90e1da6526d519ba0873b24481fbf8 /client
parent2cc360bdf2a47f968140f5b75c7668f999b36612 (diff)
parent84088d9458d2119889149c614993b18d67711a5b (diff)
downloadmariadb-git-9ed4d06706f319c2204c186afe34a899fce315ac.tar.gz
Merge 5.5 into 10.1
Diffstat (limited to 'client')
-rw-r--r--client/mysql.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/client/mysql.cc b/client/mysql.cc
index 31c1d443607..c7c902456cf 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1401,12 +1401,21 @@ sig_handler handle_sigint(int sig)
char kill_buffer[40];
MYSQL *kill_mysql= NULL;
- /* terminate if no query being executed, or we already tried interrupting */
- if (!executing_query || (interrupted_query == 2))
+ /* Terminate if we already tried interrupting. */
+ if (interrupted_query == 2)
{
tee_fprintf(stdout, "Ctrl-C -- exit!\n");
goto err;
}
+ /* If no query being executed, don't exit. */
+ if (!executing_query)
+ {
+ tee_fprintf(stdout, "Ctrl-C\n");
+ rl_on_new_line(); // Regenerate the prompt on a newline
+ rl_replace_line("", 0); // Clear the previous text
+ rl_redisplay();
+ return;
+ }
kill_mysql= mysql_init(kill_mysql);
if (!do_connect(kill_mysql,current_host, current_user, opt_password, "", 0))