summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2017-06-28 22:39:21 -0700
committerIgor Babaev <igor@askmonty.org>2017-06-28 22:40:27 -0700
commit13221b1eb20c16c0fd19079b670296aa2b789263 (patch)
tree52abd466c7269b7bcb8f7cc053af84dbda5e077b
parent18a2b0a1681af73181bd98d23ae0973fc1249df5 (diff)
downloadmariadb-git-13221b1eb20c16c0fd19079b670296aa2b789263.tar.gz
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.
-rw-r--r--mysql-test/r/cte_nonrecursive.result20
-rw-r--r--mysql-test/t/cte_nonrecursive.test10
-rw-r--r--sql/sql_prepare.cc2
3 files changed, 31 insertions, 1 deletions
diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result
index 5a5cd0bdc8e..79d380a04db 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 361ab8de28e..980bff01694 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 92137b30f77..f9da7e530cb 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