summaryrefslogtreecommitdiff
path: root/libmysqld
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-05-09 12:35:11 +0200
committerSergei Golubchik <sergii@pisem.net>2014-05-09 12:35:11 +0200
commitd3e2e1243bb0dae95ce35b0380dd4f8f476b254d (patch)
tree8779ad6b2059f181770cc07e2437925d7d5d5d04 /libmysqld
parent229dad1f9b12f8e9f64b6a605bdf8e31c339d018 (diff)
parent124428a9e28e59f98b25d8ee07b57d264f63cbe4 (diff)
downloadmariadb-git-d3e2e1243bb0dae95ce35b0380dd4f8f476b254d.tar.gz
5.5 merge
Diffstat (limited to 'libmysqld')
-rw-r--r--libmysqld/emb_qcache.cc9
-rwxr-xr-xlibmysqld/examples/test-run1
-rw-r--r--libmysqld/lib_sql.cc14
3 files changed, 20 insertions, 4 deletions
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index f1e850f4218..ccdfaf286eb 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -316,7 +316,8 @@ uint emb_count_querycache_size(THD *thd)
result+= field->def_length;
}
- if (thd->protocol == &thd->protocol_binary)
+ if (thd->protocol == &thd->protocol_binary ||
+ thd->get_command() == COM_STMT_EXECUTE)
{
result+= (uint) (4*n_rows);
for (; cur_row; cur_row=cur_row->next)
@@ -379,7 +380,8 @@ void emb_store_querycache_result(Querycache_stream *dst, THD *thd)
dst->store_safe_str(field->def, field->def_length);
}
- if (thd->protocol == &thd->protocol_binary)
+ if (thd->protocol == &thd->protocol_binary ||
+ thd->get_command() == COM_STMT_EXECUTE)
{
for (; cur_row; cur_row=cur_row->next)
dst->store_str((char *) cur_row->data, cur_row->length);
@@ -447,7 +449,8 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
data->rows= rows;
if (!rows)
goto return_ok;
- if (thd->protocol == &thd->protocol_binary)
+ if (thd->protocol == &thd->protocol_binary ||
+ thd->get_command() == COM_STMT_EXECUTE)
{
uint length;
row= (MYSQL_ROWS *)alloc_root(&data->alloc,
diff --git a/libmysqld/examples/test-run b/libmysqld/examples/test-run
index 9db0f20cb82..3b1cff2ddd8 100755
--- a/libmysqld/examples/test-run
+++ b/libmysqld/examples/test-run
@@ -1,6 +1,7 @@
#! /bin/sh
# Copyright (C) 2001, 2006 MySQL AB
+# Use is subject to license terms
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 1c043c6d03b..9024ae9321e 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -40,6 +40,7 @@ C_MODE_START
extern unsigned int mysql_server_last_errno;
extern char mysql_server_last_error[MYSQL_ERRMSG_SIZE];
static my_bool emb_read_query_result(MYSQL *mysql);
+static void emb_free_embedded_thd(MYSQL *mysql);
extern "C" void unireg_clear(int exit_code)
@@ -107,6 +108,17 @@ emb_advanced_command(MYSQL *mysql, enum enum_server_command command,
NET *net= &mysql->net;
my_bool stmt_skip= stmt ? stmt->state != MYSQL_STMT_INIT_DONE : FALSE;
+ if (thd->killed != NOT_KILLED)
+ {
+ if (thd->killed < KILL_CONNECTION)
+ thd->killed= NOT_KILLED;
+ else
+ {
+ emb_free_embedded_thd(mysql);
+ thd= 0;
+ }
+ }
+
if (!thd)
{
/* Do "reconnect" if possible */
@@ -1286,7 +1298,7 @@ bool Protocol::net_store_data(const uchar *from, size_t length)
}
-bool Protocol::net_store_data(const uchar *from, size_t length,
+bool Protocol::net_store_data_cs(const uchar *from, size_t length,
CHARSET_INFO *from_cs, CHARSET_INFO *to_cs)
{
uint conv_length= to_cs->mbmaxlen * length / from_cs->mbminlen;