diff options
author | Igor Babaev <igor@askmonty.org> | 2011-11-20 04:53:07 -0800 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2011-11-20 04:53:07 -0800 |
commit | 3c496ea9ad4e7ef289eee35f9775c58a0e5f82b8 (patch) | |
tree | 6f4161966352a836565b43307f7eaec0f3a0f5c5 /mysql-test/r/ps.result | |
parent | 5a4c91003a73c551d89e0c6878edfe03704352fe (diff) | |
download | mariadb-git-3c496ea9ad4e7ef289eee35f9775c58a0e5f82b8.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/r/ps.result')
-rw-r--r-- | mysql-test/r/ps.result | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index ca847188ce9..90981166fb6 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -3058,3 +3058,60 @@ date('2010-10-10') between '2010-09-09' and ? execute stmt using @a; date('2010-10-10') between '2010-09-09' and ? 0 +# +# Bug #892725: look-up is changed for a full scan when executing PS +# +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; +a b +8 70 +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +execute st; +a b +8 70 +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +flush status; +select * from t1 use index() where a=3; +a b +3 40 +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 0 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 8 +flush status; +execute st; +a b +8 70 +show status like '%Handler_read%'; +Variable_name Value +Handler_read_first 0 +Handler_read_key 1 +Handler_read_next 0 +Handler_read_prev 0 +Handler_read_rnd 0 +Handler_read_rnd_next 0 +deallocate prepare st; +drop table t1; |