[Commits] Rev 4150: MDEV-5138 Numerous test failures in "mtr --ps --embedded". in file:///home/hf/wmar/mdev-5138-2/

holyfoot at askmonty.org holyfoot at askmonty.org
Tue Apr 15 17:29:19 EEST 2014


At file:///home/hf/wmar/mdev-5138-2/

------------------------------------------------------------
revno: 4150
revision-id: holyfoot at askmonty.org-20140415130958-h7pxds5vllp2oruj
parent: holyfoot at askmonty.org-20140415130833-u1qzp41dsyo9aggj
committer: Alexey Botchkov <holyfoot at askmonty.org>
branch nick: mdev-5138-2
timestamp: Tue 2014-04-15 18:09:58 +0500
message:
  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.
-------------- next part --------------
=== modified file 'libmysqld/emb_qcache.cc'
--- a/libmysqld/emb_qcache.cc	2013-03-19 12:36:34 +0000
+++ b/libmysqld/emb_qcache.cc	2014-04-15 13:09:58 +0000
@@ -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(Queryca
     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,
   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,

=== modified file 'mysql-test/r/ctype_ucs2_query_cache.result'
--- a/mysql-test/r/ctype_ucs2_query_cache.result	2013-05-17 06:16:56 +0000
+++ b/mysql-test/r/ctype_ucs2_query_cache.result	2014-04-15 13:09:58 +0000
@@ -13,6 +13,12 @@ SELECT * FROM t1;
 2
 3
 4
+SELECT * FROM t1;
+a
+1
+2
+3
+4
 DROP TABLE t1;
 #
 # End of 5.5 tests

=== modified file 'mysql-test/t/ctype_ucs2_query_cache.test'
--- a/mysql-test/t/ctype_ucs2_query_cache.test	2013-05-17 06:16:56 +0000
+++ b/mysql-test/t/ctype_ucs2_query_cache.test	2014-04-15 13:09:58 +0000
@@ -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 #



More information about the commits mailing list