1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 5.1-bugteam -> 5.1-bug-42496

This commit is contained in:
Dmitry Shulga
2010-07-23 18:15:56 +07:00
299 changed files with 9856 additions and 2453 deletions

View File

@ -465,6 +465,12 @@ static void handle_bootstrap_impl(THD *thd)
}
buff= (char*) thd->net.buff;
res= fgets(buff + length, thd->net.max_packet - length, file);
if (!res && !feof(file))
{
net_end_statement(thd);
bootstrap_error= 1;
break;
}
length+= (ulong) strlen(buff + length);
/* purecov: end */
}
@ -1535,7 +1541,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
{
STATUS_VAR current_global_status_var;
ulong uptime;
uint length;
uint length __attribute__((unused));
ulonglong queries_per_second1000;
char buff[250];
uint buff_len= sizeof(buff);
@ -1548,7 +1554,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
else
queries_per_second1000= thd->query_id * LL(1000) / uptime;
length= my_snprintf((char*) buff, buff_len - 1,
length= my_snprintf(buff, buff_len - 1,
"Uptime: %lu Threads: %d Questions: %lu "
"Slow queries: %lu Opens: %lu Flush tables: %lu "
"Open tables: %u Queries per second avg: %u.%u",
@ -1560,10 +1566,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
cached_open_tables(),
(uint) (queries_per_second1000 / 1000),
(uint) (queries_per_second1000 % 1000));
#ifdef EMBEDDED_LIBRARY
/* Store the buffer in permanent memory */
my_ok(thd, 0, 0, buff);
#endif
#ifdef SAFEMALLOC
if (sf_malloc_cur_memory) // Using SAFEMALLOC
{
@ -1578,6 +1580,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
VOID(my_net_write(net, (uchar*) buff, length));
VOID(net_flush(net));
thd->main_da.disable_status();
#else
/* Store the buffer in permanent memory */
my_ok(thd, 0, 0, buff);
#endif
break;
}
@ -7664,7 +7669,7 @@ LEX_USER *create_default_definer(THD *thd)
if (! (definer= (LEX_USER*) thd->alloc(sizeof(LEX_USER))))
return 0;
get_default_definer(thd, definer);
thd->get_definer(definer);
return definer;
}