summaryrefslogtreecommitdiff
path: root/mysql-test/t/subselect.test
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2004-08-22 00:06:19 +0500
committerunknown <hf@deer.(none)>2004-08-22 00:06:19 +0500
commitac4c0538529c0bf351d116b0b9d2c58c7fc3bc35 (patch)
treed3f995a484790563261079b4da581b7e2250478b /mysql-test/t/subselect.test
parent8f68a9eb6f62183742d8f37bc5ec94a48e831a5d (diff)
downloadmariadb-git-ac4c0538529c0bf351d116b0b9d2c58c7fc3bc35.tar.gz
Proposed fix for bug #5003 (subselect with MIN() and LIKE crashes server)
We have next problem here: active_index is wrong in the subselect's handler on the second val_int() call. Optimizer sees that we can use index-read for that kind of condition, and matching_cond() (sql/opt_sum.cc) doesn't. I suspect, proper solution is to add appropriate code to the matching_cond() but now just added missed initialization. mysql-test/r/subselect.result: Appropriate test result mysql-test/t/subselect.test: Test case added sql/records.cc: index's initialization added
Diffstat (limited to 'mysql-test/t/subselect.test')
-rw-r--r--mysql-test/t/subselect.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 02a570b1db3..4bb0be02b01 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -1235,3 +1235,15 @@ select a from t2 where a in (select a from t1 where match(b) against ('Ball') >
drop table t1,t2;
+#
+# BUG#5003 - like in subselect
+#
+CREATE TABLE t1(`IZAVORGANG_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`KUERZEL` VARCHAR(10) CHARACTER SET latin1 COLLATE latin1_bin,`IZAANALYSEART_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin,`IZAPMKZ_ID` VARCHAR(11) CHARACTER SET latin1 COLLATE latin1_bin);
+CREATE INDEX AK01IZAVORGANG ON t1(izaAnalyseart_id,Kuerzel);
+INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000001','601','D0000000001','I0000000001');
+INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000002','602','D0000000001','I0000000001');
+INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000003','603','D0000000001','I0000000001');
+INSERT INTO t1(`IZAVORGANG_ID`,`KUERZEL`,`IZAANALYSEART_ID`,`IZAPMKZ_ID`)VALUES('D0000000004','101','D0000000001','I0000000001');
+SELECT `IZAVORGANG_ID` FROM t1 WHERE `KUERZEL` IN(SELECT MIN(`KUERZEL`)`Feld1` FROM t1 WHERE `KUERZEL` LIKE'601%'And`IZAANALYSEART_ID`='D0000000001');
+drop table t1;
+