summaryrefslogtreecommitdiff
path: root/mysql-test/t/ps.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-11-20 04:53:07 -0800
committerIgor Babaev <igor@askmonty.org>2011-11-20 04:53:07 -0800
commit3ff9d871c47fabe519fb9b753514ff54871a101f (patch)
tree6f4161966352a836565b43307f7eaec0f3a0f5c5 /mysql-test/t/ps.test
parent3daafb824dc50e0508ccb85935901438bf92cb10 (diff)
downloadmariadb-git-3ff9d871c47fabe519fb9b753514ff54871a101f.tar.gz
Fixed LP bug #892725.
A non-first execution of a prepared statement missed a call of the TABLE_LIST::process_index_hints() method in the code of the function setup_tables(). At some scenarios this could lead to the choice of a quite inefficient execution plan for the base query of the prepared statement.
Diffstat (limited to 'mysql-test/t/ps.test')
-rw-r--r--mysql-test/t/ps.test27
1 files changed, 27 insertions, 0 deletions
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 55ddad701c4..f4e27f3ba42 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3119,3 +3119,30 @@ set @a='2010-08-08';
execute stmt using @a;
execute stmt using @a;
+--echo #
+--echo # Bug #892725: look-up is changed for a full scan when executing PS
+--echo #
+
+create table t1 (a int primary key, b int);
+insert into t1 values
+ (7,70), (3,40), (4,40), (8,70), (1,70), (9,50), (2,70);
+
+prepare st from 'select * from t1 where a=8';
+
+flush status;
+execute st;
+show status like '%Handler_read%';
+flush status;
+execute st;
+show status like '%Handler_read%';
+flush status;
+select * from t1 use index() where a=3;
+show status like '%Handler_read%';
+flush status;
+execute st;
+show status like '%Handler_read%';
+
+deallocate prepare st;
+
+drop table t1;
+