1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-31 22:22:30 +03:00

Merge WL#5138 to mysql-next-mr

This commit is contained in:
Mikael Ronstrom
2009-11-27 18:11:05 +01:00
191 changed files with 5132 additions and 1451 deletions

View File

@@ -510,9 +510,7 @@ static void handle_bootstrap_impl(THD *thd)
break;
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
#ifdef USING_TRANSACTIONS
free_root(&thd->transaction.mem_root,MYF(MY_KEEP_PREALLOC));
#endif
}
DBUG_VOID_RETURN;
@@ -811,11 +809,7 @@ bool do_command(THD *thd)
net_new_transaction(net);
packet_length= my_net_read(net);
#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
#endif
if (packet_length == packet_error)
if ((packet_length= my_net_read(net)) == packet_error)
{
DBUG_PRINT("info",("Got error %d reading command from socket %s",
net->error,
@@ -872,9 +866,6 @@ bool do_command(THD *thd)
return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1));
out:
#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
#endif
DBUG_RETURN(return_value);
}
#endif /* EMBEDDED_LIBRARY */
@@ -976,6 +967,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
DBUG_ENTER("dispatch_command");
DBUG_PRINT("info",("packet: '%*.s'; command: %d", packet_length, packet, command));
#if defined(ENABLED_PROFILING)
thd->profiling.start_new_query();
#endif
MYSQL_COMMAND_START(thd->thread_id, command,
thd->security_ctx->priv_user,
(char *) thd->security_ctx->host_or_ip);
@@ -1010,6 +1004,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->set_query_id(query_id);
}
inc_thread_running();
/* TODO: set thd->lex->sql_command to SQLCOM_END here */
/**
Clear the set of flags that are expected to be cleared at the
@@ -1232,9 +1227,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->profiling.set_query_source(thd->query(), thd->query_length());
#endif
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),QUERY_PRIOR);
mysql_parse(thd, thd->query(), thd->query_length(), &end_of_stmt);
while (!thd->killed && (end_of_stmt != NULL) && ! thd->is_error())
@@ -1284,8 +1276,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
mysql_parse(thd, beginning_of_next_stmt, length, &end_of_stmt);
}
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),WAIT_PRIOR);
DBUG_PRINT("info",("query ready"));
break;
}
@@ -1500,8 +1490,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
#endif
#ifndef EMBEDDED_LIBRARY
VOID(my_net_write(net, (uchar*) buff, length));
VOID(net_flush(net));
(void) my_net_write(net, (uchar*) buff, length);
(void) net_flush(net);
thd->stmt_da->disable_status();
#endif
break;
@@ -1601,6 +1591,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
#endif
if (MYSQL_QUERY_DONE_ENABLED() || MYSQL_COMMAND_DONE_ENABLED())
{
int res;
@@ -7182,7 +7175,7 @@ uint kill_one_thread(THD *thd, ulong id, bool only_kill_query)
uint error=ER_NO_SUCH_THREAD;
DBUG_ENTER("kill_one_thread");
DBUG_PRINT("enter", ("id=%lu only_kill=%d", id, only_kill_query));
VOID(pthread_mutex_lock(&LOCK_thread_count)); // For unlink from list
pthread_mutex_lock(&LOCK_thread_count); // For unlink from list
I_List_iterator<THD> it(threads);
while ((tmp=it++))
{
@@ -7194,7 +7187,7 @@ uint kill_one_thread(THD *thd, ulong id, bool only_kill_query)
break;
}
}
VOID(pthread_mutex_unlock(&LOCK_thread_count));
pthread_mutex_unlock(&LOCK_thread_count);
if (tmp)
{