summaryrefslogtreecommitdiff
path: root/mysql-test/r/ps.result
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-05-03 12:47:27 +0400
committerkonstantin@mysql.com <>2005-05-03 12:47:27 +0400
commit3589e78fdaad94daaefa69054588b2769c0096b1 (patch)
tree08af187bf187a284afa4c4965c0bedf2de9add60 /mysql-test/r/ps.result
parent4b9f462da72bf125f74d3640946607c9735e471f (diff)
downloadmariadb-git-3589e78fdaad94daaefa69054588b2769c0096b1.tar.gz
A fix and test case for Bug#9096 "select doesn't return all matched
records if prepared statements is used". This fix changes equality evaluation method of basic constants from by-name to by-value, thus effectively enabling use of parameter markers in some optimizations (constants propagation, evaluation of possible keys for query).
Diffstat (limited to 'mysql-test/r/ps.result')
-rw-r--r--mysql-test/r/ps.result25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 89c369a51e8..df3e24afd1a 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -494,3 +494,28 @@ SELECT FOUND_ROWS();
FOUND_ROWS()
2
deallocate prepare stmt;
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+create table t1 (c1 int(11) not null, c2 int(11) not null,
+primary key (c1,c2), key c2 (c2), key c1 (c1));
+insert into t1 values (200887, 860);
+insert into t1 values (200887, 200887);
+select * from t1 where (c1=200887 and c2=200887) or c2=860;
+c1 c2
+200887 860
+200887 200887
+prepare stmt from
+"select * from t1 where (c1=200887 and c2=200887) or c2=860";
+execute stmt;
+c1 c2
+200887 860
+200887 200887
+prepare stmt from
+"select * from t1 where (c1=200887 and c2=?) or c2=?";
+set @a=200887, @b=860;
+execute stmt using @a, @b;
+c1 c2
+200887 860
+200887 200887
+deallocate prepare stmt;