From 20b72a3fad45bd8fc0bf6987fcec0c21b4f36885 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 30 Oct 2019 00:47:50 +0100 Subject: compilation fix for Windows --- client/mysql.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/mysql.cc b/client/mysql.cc index 86ee22e5e6a..7329f2298ab 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1378,9 +1378,11 @@ sig_handler handle_sigint(int sig) if (!executing_query) { tee_fprintf(stdout, "Ctrl-C\n"); +#ifdef HAVE_READLINE rl_on_new_line(); // Regenerate the prompt on a newline rl_replace_line("", 0); // Clear the previous text rl_redisplay(); +#endif return; } -- cgit v1.2.1 From afb4878703e71307af0fe8723f8ab10e8d4e0288 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 25 Jun 2019 15:52:05 +0400 Subject: MDEV-18783 - Server crash in hp_rb_make_key In debug build, whenever MEMORY table instance gets closed it performs consistency check without protection. It may cause server crash if executed concurrently with DML. Moved consistency check to ha_heap::external_lock(F_UNLCK), so that it is protected by THR_LOCK. --- storage/heap/ha_heap.cc | 4 ++++ storage/heap/hp_close.c | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index a1b8db34453..60a41cc52e7 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -453,6 +453,10 @@ int ha_heap::reset_auto_increment(ulonglong value) int ha_heap::external_lock(THD *thd, int lock_type) { +#ifndef DBUG_OFF + if (lock_type == F_UNLCK && file->s->changed && heap_check_heap(file, 0)) + return HA_ERR_CRASHED; +#endif return 0; // No external locking } diff --git a/storage/heap/hp_close.c b/storage/heap/hp_close.c index 092048a7c1c..82d6186340a 100644 --- a/storage/heap/hp_close.c +++ b/storage/heap/hp_close.c @@ -35,12 +35,6 @@ int hp_close(register HP_INFO *info) { int error=0; DBUG_ENTER("hp_close"); -#ifndef DBUG_OFF - if (info->s->changed && heap_check_heap(info,0)) - { - error=my_errno=HA_ERR_CRASHED; - } -#endif info->s->changed=0; if (info->open_list.data) heap_open_list=list_delete(heap_open_list,&info->open_list); -- cgit v1.2.1 From 9277b6ec1ce8bc195a10b5deb11d65843adf8972 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 30 Oct 2019 14:38:18 +0100 Subject: Revert "MDEV-14448: Ctrl-C should not exit the client" This reverts commit 396313d301b3567aeadd04ae6a9322da2adc0a8b. --- client/mysql.cc | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 7329f2298ab..50d45696a5c 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1368,23 +1368,12 @@ sig_handler handle_sigint(int sig) char kill_buffer[40]; MYSQL *kill_mysql= NULL; - /* Terminate if we already tried interrupting. */ - if (interrupted_query == 2) + /* terminate if no query being executed, or we already tried interrupting */ + if (!executing_query || (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"); -#ifdef HAVE_READLINE - rl_on_new_line(); // Regenerate the prompt on a newline - rl_replace_line("", 0); // Clear the previous text - rl_redisplay(); -#endif - return; - } kill_mysql= mysql_init(kill_mysql); if (!mysql_real_connect(kill_mysql,current_host, current_user, opt_password, -- cgit v1.2.1