summaryrefslogtreecommitdiff
path: root/mysql-test/t/ps.test
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-03-03 01:37:54 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-03-03 01:37:54 +0200
commit1acfa942edb72fedcf92dd017ae5fef8694382e5 (patch)
tree721fcd9a479ce34633659c936f36fa1e20856620 /mysql-test/t/ps.test
parentcc413ce9a368b930aba5e63c0ab013f7b3ab3c04 (diff)
parent5a0fff50f87e20c4e95a84143a0a3bb67e03e29e (diff)
downloadmariadb-git-1acfa942edb72fedcf92dd017ae5fef8694382e5.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysql-test/t/ps.test')
-rw-r--r--mysql-test/t/ps.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index a6b238b84c6..d7ca29083b5 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3680,5 +3680,38 @@ EXECUTE stmt;
deallocate prepare stmt;
drop table t1,t2,t3,t4;
+--echo #
+--echo # MDEV-11859: the plans for the first and the second executions
+--echo # of PS are not the same
+--echo #
+
+create table t1 (id int, c varchar(3), key idx(c))engine=myisam;
+insert into t1 values (3,'bar'), (1,'xxx'), (2,'foo'), (5,'yyy');
+
+prepare stmt1 from
+"explain extended
+ select * from t1 where (1, 2) in ( select 3, 4 ) or c = 'foo'";
+execute stmt1;
+execute stmt1;
+deallocate prepare stmt1;
+
+prepare stmt1 from
+"select * from t1 where (1, 2) in ( select 3, 4 ) or c = 'foo'";
+flush status;
+execute stmt1;
+show status like '%Handler_read%';
+flush status;
+execute stmt1;
+show status like '%Handler_read%';
+deallocate prepare stmt1;
+
+prepare stmt2 from
+"explain extended
+ select * from t1 where (1, 2) in ( select 3, 4 )";
+execute stmt2;
+execute stmt2;
+deallocate prepare stmt2;
+
+drop table t1;
--echo # End of 5.5 tests