summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2014-04-15 18:09:58 +0500
committerAlexey Botchkov <holyfoot@askmonty.org>2014-04-15 18:09:58 +0500
commit365960a068d4aaaa04340fe225d5b52b2feec70f (patch)
tree4dbc23d93336dd2cc89f3d4f0f6b97b6204a24d0
parent7d1033115a5c04a30a9a044ceb8f71047162d200 (diff)
downloadmariadb-git-365960a068d4aaaa04340fe225d5b52b2feec70f.tar.gz
MDEV-5138 Numerous test failures in "mtr --ps --embedded".
As Davi added code like sav_protocol= thd->protocol thd->protocol= &thd->protocol_binary ... thd->protocol= sav_protocol the fucntions like emb_store_querycache_result() cannot determine the used protocol testing thd->protocol == &thd->protocol_binary. Fixed by additional check thd->command == COM_STMT_EXECUTE.
-rw-r--r--libmysqld/emb_qcache.cc9
-rw-r--r--mysql-test/r/ctype_ucs2_query_cache.result6
-rw-r--r--mysql-test/t/ctype_ucs2_query_cache.test1
3 files changed, 13 insertions, 3 deletions
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index d263e5d5fe8..53e7ced424c 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->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->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->command == COM_STMT_EXECUTE)
{
uint length;
row= (MYSQL_ROWS *)alloc_root(&data->alloc,
diff --git a/mysql-test/r/ctype_ucs2_query_cache.result b/mysql-test/r/ctype_ucs2_query_cache.result
index c5f1ef5918d..6f26bed02da 100644
--- a/mysql-test/r/ctype_ucs2_query_cache.result
+++ b/mysql-test/r/ctype_ucs2_query_cache.result
@@ -13,6 +13,12 @@ a
2
3
4
+SELECT * FROM t1;
+a
+1
+2
+3
+4
DROP TABLE t1;
#
# End of 5.5 tests
diff --git a/mysql-test/t/ctype_ucs2_query_cache.test b/mysql-test/t/ctype_ucs2_query_cache.test
index bdc1d079d5e..0ac09b2ba4b 100644
--- a/mysql-test/t/ctype_ucs2_query_cache.test
+++ b/mysql-test/t/ctype_ucs2_query_cache.test
@@ -12,6 +12,7 @@
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
SELECT * FROM t1;
+SELECT * FROM t1;
DROP TABLE t1;
--echo #