Commit 7c19d664 authored by Michael Widenius's avatar Michael Widenius

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.
parent b5f68c5f
......@@ -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)
......
......@@ -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' fr Feld '%.192s' in Zeile %ld"
eng "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %lu"
ger "Falscher %-.32s-Wert: '%-.128s' fr Feld '%.192s' in Zeile %lu"
ER_ILLEGAL_VALUE_FOR_TYPE 22007
eng "Illegal %s '%-.192s' value found during parsing"
ger "Nicht zulssiger %s-Wert '%-.192s' beim Parsen gefunden"
......
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment