[Commits] 48e790b: Fixed a failure of the test case for the bug mdev-13107 in --ps-protocol.

IgorBabaev igor at mariadb.com
Thu Jun 29 08:39:21 EEST 2017


revision-id: 48e790bca9ffdfb8282ac5d4b1c19850d1526cb6 (mariadb-10.2.6-75-g48e790b)
parent(s): e60802394743d990e71754716c5f3cc234f581c1
author: Igor Babaev
committer: Igor Babaev
timestamp: 2017-06-28 22:39:21 -0700
message:

Fixed a failure of the test case for the bug mdev-13107 in --ps-protocol.

The fix was in the call the open_normal_and_derived_tables() from
the function mysql_test_select() and it was similar to those from
the patch for mdev-13107.

Added explicit PREPARE statements that failed in --ps-protocol.

---
 mysql-test/r/cte_nonrecursive.result | 20 ++++++++++++++++++++
 mysql-test/t/cte_nonrecursive.test   | 10 ++++++++++
 sql/sql_prepare.cc                   |  2 +-
 3 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result
index 5a5cd0b..79d380a 100644
--- a/mysql-test/r/cte_nonrecursive.result
+++ b/mysql-test/r/cte_nonrecursive.result
@@ -1033,5 +1033,25 @@ a
 3
 1
 2
+prepare stmt1 from "select * from v1";
+execute stmt1;
+a
+2
+execute stmt1;
+a
+2
+prepare stmt2 from "select * from v2";
+execute stmt2;
+a
+3
+1
+2
+execute stmt2;
+a
+3
+1
+2
+deallocate prepare stmt1;
+deallocate prepare stmt2;
 drop view v1,v2;
 drop table t1,t2;
diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test
index 361ab8d..980bff0 100644
--- a/mysql-test/t/cte_nonrecursive.test
+++ b/mysql-test/t/cte_nonrecursive.test
@@ -712,5 +712,15 @@ show create view v2;
 select * from v1;
 select * from v2;
 
+prepare stmt1 from "select * from v1";
+execute stmt1;
+execute stmt1;
+prepare stmt2 from "select * from v2";
+execute stmt2;
+execute stmt2;
+
+deallocate prepare stmt1;
+deallocate prepare stmt2;
+
 drop view v1,v2;
 drop table t1,t2;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 92137b3..f9da7e5 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1590,7 +1590,7 @@ static int mysql_test_select(Prepared_statement *stmt,
   }
 
   if (open_normal_and_derived_tables(thd, tables,  MYSQL_OPEN_FORCE_SHARED_MDL,
-                                     DT_PREPARE | DT_CREATE))
+                                     DT_INIT | DT_PREPARE | DT_CREATE))
     goto error;
 
   thd->lex->used_tables= 0;                        // Updated by setup_fields


More information about the commits mailing list