diff options
author | Michael Widenius <monty@askmonty.org> | 2009-12-04 17:12:22 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-12-04 17:12:22 +0200 |
commit | d8e44ef589964a7afc28ffd7c1398be168a9d693 (patch) | |
tree | f814db32e6d16f2b471eec465a750874cf496106 | |
parent | 9aafd0dae2e9302b7af877f1670b5dc7360a7daf (diff) | |
download | mariadb-git-d8e44ef589964a7afc28ffd7c1398be168a9d693.tar.gz |
Fixed Bug#47017 rpl_timezone fails on PB-2 with mismatch error
Fixed coredump in sql_plugin.cc:intern_plugin_lock() on mysqld start with PBXT
sql/mysqld.cc:
Fixed coredump in sql_plugin.cc:intern_plugin_lock() on mysqld start with PBXT
sql/share/errmsg.txt:
Row numbers are always positive
sql/sql_base.cc:
Fixed race condition in lock tables when killing insert_delayed thread.
This fixes Bug#47017 rpl_timezone fails on PB-2 with mismatch error
(Note that the patch only adds a continue; The rest is (required) indentation changes)
sql/sql_class.cc:
Fixed wrong output for high end machines in outfile_loaddata.
(Problem was that ER_TRUNCATED_WRONG_VALUE_FOR_FIELD expects ulong, not ulonglong)
sql/sql_insert.cc:
Ensure that if we get a lock problem with delayed_insert, the error is logged.
-rw-r--r-- | sql/mysqld.cc | 2 | ||||
-rw-r--r-- | sql/share/errmsg.txt | 4 | ||||
-rw-r--r-- | sql/sql_base.cc | 31 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 | ||||
-rw-r--r-- | sql/sql_insert.cc | 11 |
5 files changed, 30 insertions, 20 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 61a7c16cd90..e3a39ceee63 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4169,8 +4169,10 @@ server."); Need to unlock as global_system_variables.table_plugin was acquired during plugin_init() */ + pthread_mutex_lock(&LOCK_global_system_variables); plugin_unlock(0, global_system_variables.table_plugin); global_system_variables.table_plugin= plugin; + pthread_mutex_unlock(&LOCK_global_system_variables); } } #if defined(WITH_MARIA_STORAGE_ENGINE) && defined(USE_MARIA_FOR_TMP_TABLES) diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 20f51a952bc..8bd4198f890 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -5322,8 +5322,8 @@ ER_DIVISION_BY_ZERO 22012 eng "Division by 0" ger "Division durch 0" ER_TRUNCATED_WRONG_VALUE_FOR_FIELD - eng "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %ld" - ger "Falscher %-.32s-Wert: '%-.128s' für Feld '%.192s' in Zeile %ld" + eng "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %lu" + ger "Falscher %-.32s-Wert: '%-.128s' für Feld '%.192s' in Zeile %lu" ER_ILLEGAL_VALUE_FOR_TYPE 22007 eng "Illegal %s '%-.192s' value found during parsing" ger "Nicht zulässiger %s-Wert '%-.192s' beim Parsen gefunden" diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a0616fa6a4a..fc024591592 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -8488,19 +8488,26 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, result=1; } /* Kill delayed insert threads */ - if ((in_use->system_thread & SYSTEM_THREAD_DELAYED_INSERT) && - ! in_use->killed) + if ((in_use->system_thread & SYSTEM_THREAD_DELAYED_INSERT)) { - in_use->killed= THD::KILL_CONNECTION; - pthread_mutex_lock(&in_use->mysys_var->mutex); - if (in_use->mysys_var->current_cond) - { - pthread_mutex_lock(in_use->mysys_var->current_mutex); - signalled= 1; - pthread_cond_broadcast(in_use->mysys_var->current_cond); - pthread_mutex_unlock(in_use->mysys_var->current_mutex); - } - pthread_mutex_unlock(&in_use->mysys_var->mutex); + if (!in_use->killed) + { + in_use->killed= THD::KILL_CONNECTION; + pthread_mutex_lock(&in_use->mysys_var->mutex); + if (in_use->mysys_var->current_cond) + { + pthread_mutex_lock(in_use->mysys_var->current_mutex); + signalled= 1; + pthread_cond_broadcast(in_use->mysys_var->current_cond); + pthread_mutex_unlock(in_use->mysys_var->current_mutex); + } + pthread_mutex_unlock(&in_use->mysys_var->mutex); + } + /* + Don't abort locks. Instead give the delayed insert thread + time to finish it's inserts and die gracefully. + */ + continue; } /* Now we must abort all tables locks used by this thread diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 0e837d382b0..bf254534e4d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2046,7 +2046,7 @@ bool select_export::send_data(List<Item> &items) ER_TRUNCATED_WRONG_VALUE_FOR_FIELD, ER(ER_TRUNCATED_WRONG_VALUE_FOR_FIELD), "string", printable_buff, - item->name, row_count); + item->name, (ulong) row_count); } cvt_str.length(bytes); res= &cvt_str; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 937576f4a68..8b78114716a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -2618,7 +2618,7 @@ bool Delayed_insert::handle_inserts(void) or if another thread is removing the current table definition from the table cache. */ - my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR), + my_error(ER_DELAYED_CANT_CHANGE_LOCK, MYF(ME_FATALERROR | ME_NOREFRESH), table->s->table_name.str); goto err; } @@ -2791,10 +2791,11 @@ bool Delayed_insert::handle_inserts(void) query_cache_invalidate3(&thd, table, 1); if (thr_reschedule_write_lock(*thd.lock->locks)) { - /* This is not known to happen. */ - my_error(ER_DELAYED_CANT_CHANGE_LOCK,MYF(ME_FATALERROR), - table->s->table_name.str); - goto err; + /* This is not known to happen. */ + my_error(ER_DELAYED_CANT_CHANGE_LOCK, + MYF(ME_FATALERROR | ME_NOREFRESH), + table->s->table_name.str); + goto err; } if (!using_bin_log) table->file->extra(HA_EXTRA_WRITE_CACHE); |