mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
5.5 merge
This commit is contained in:
@ -2250,11 +2250,8 @@ bool delayed_get_table(THD *thd, MDL_request *grl_protection_request,
|
||||
want to send "Server shutdown in progress" in the
|
||||
INSERT THREAD.
|
||||
*/
|
||||
if (di->thd.stmt_da->sql_errno() == ER_SERVER_SHUTDOWN)
|
||||
my_message(ER_QUERY_INTERRUPTED, ER(ER_QUERY_INTERRUPTED), MYF(0));
|
||||
else
|
||||
my_message(di->thd.stmt_da->sql_errno(), di->thd.stmt_da->message(),
|
||||
MYF(0));
|
||||
my_message(di->thd.stmt_da->sql_errno(), di->thd.stmt_da->message(),
|
||||
MYF(0));
|
||||
}
|
||||
di->unlock();
|
||||
goto end_create;
|
||||
@ -2303,7 +2300,8 @@ end_create:
|
||||
TABLE *Delayed_insert::get_local_table(THD* client_thd)
|
||||
{
|
||||
my_ptrdiff_t adjust_ptrs;
|
||||
Field **field,**org_field, *found_next_number_field, **dfield_ptr= 0;
|
||||
Field **field,**org_field, *found_next_number_field;
|
||||
Field **UNINIT_VAR(vfield), **UNINIT_VAR(dfield_ptr);
|
||||
TABLE *copy;
|
||||
TABLE_SHARE *share;
|
||||
uchar *bitmap;
|
||||
@ -2339,7 +2337,7 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
|
||||
killed using mysql_notify_thread_having_shared_lock() or
|
||||
kill_delayed_threads_for_table().
|
||||
*/
|
||||
if (!thd.is_error() || thd.stmt_da->sql_errno() == ER_SERVER_SHUTDOWN)
|
||||
if (!thd.is_error())
|
||||
my_message(ER_QUERY_INTERRUPTED, ER(ER_QUERY_INTERRUPTED), MYF(0));
|
||||
else
|
||||
my_message(thd.stmt_da->sql_errno(), thd.stmt_da->message(), MYF(0));
|
||||
@ -2363,6 +2361,13 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
|
||||
if (!copy_tmp)
|
||||
goto error;
|
||||
|
||||
if (share->vfields)
|
||||
{
|
||||
vfield= (Field **) client_thd->alloc((share->vfields+1)*sizeof(Field*));
|
||||
if (!vfield)
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* Copy the TABLE object. */
|
||||
copy= new (copy_tmp) TABLE;
|
||||
*copy= *table;
|
||||
@ -2408,6 +2413,28 @@ TABLE *Delayed_insert::get_local_table(THD* client_thd)
|
||||
}
|
||||
}
|
||||
*field=0;
|
||||
|
||||
if (share->vfields)
|
||||
{
|
||||
copy->vfield= vfield;
|
||||
for (field= copy->field; *field; field++)
|
||||
{
|
||||
if ((*field)->vcol_info)
|
||||
{
|
||||
bool error_reported= FALSE;
|
||||
if (unpack_vcol_info_from_frm(client_thd,
|
||||
client_thd->mem_root,
|
||||
copy,
|
||||
*field,
|
||||
&(*field)->vcol_info->expr_str,
|
||||
&error_reported))
|
||||
goto error;
|
||||
*vfield++= *field;
|
||||
}
|
||||
}
|
||||
*vfield= 0;
|
||||
}
|
||||
|
||||
if (share->default_fields)
|
||||
*dfield_ptr= NULL;
|
||||
|
||||
@ -2715,7 +2742,10 @@ pthread_handler_t handle_delayed_insert(void *arg)
|
||||
thd->thread_id= thd->variables.pseudo_thread_id= thread_id++;
|
||||
thd->set_current_time();
|
||||
threads.append(thd);
|
||||
thd->killed=abort_loop ? KILL_CONNECTION : NOT_KILLED;
|
||||
if (abort_loop)
|
||||
thd->killed= KILL_CONNECTION;
|
||||
else
|
||||
thd->reset_killed();
|
||||
mysql_mutex_unlock(&LOCK_thread_count);
|
||||
|
||||
mysql_thread_set_psi_id(thd->thread_id);
|
||||
@ -2814,8 +2844,12 @@ pthread_handler_t handle_delayed_insert(void *arg)
|
||||
set_timespec(abstime, delayed_insert_timeout);
|
||||
|
||||
/* Information for pthread_kill */
|
||||
mysql_mutex_unlock(&di->mutex);
|
||||
mysql_mutex_lock(&di->thd.mysys_var->mutex);
|
||||
di->thd.mysys_var->current_mutex= &di->mutex;
|
||||
di->thd.mysys_var->current_cond= &di->cond;
|
||||
mysql_mutex_unlock(&di->thd.mysys_var->mutex);
|
||||
mysql_mutex_lock(&di->mutex);
|
||||
thd_proc_info(&(di->thd), "Waiting for INSERT");
|
||||
|
||||
DBUG_PRINT("info",("Waiting for someone to insert rows"));
|
||||
|
Reference in New Issue
Block a user