Below is the list of changes that have just been committed into a local
4.1 repository of hf. When hf does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.1997 04/08/22 00:06:19 hf@deer.(none) +3 -0
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.
sql/records.cc
1.28 04/08/22 00:06:16 hf@deer.(none) +3 -0
index's initialization added
mysql-test/t/subselect.test
1.116 04/08/22 00:06:16 hf@deer.(none) +12 -0
Test case added
mysql-test/r/subselect.result
1.134 04/08/22 00:06:16 hf@deer.(none) +10 -0
Appropriate test result
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: hf
# Host: deer.(none)
# Root: /home/hf/work/mysql-4.1.emb
--- 1.27/sql/records.cc Fri Jun 25 20:49:10 2004
+++ 1.28/sql/records.cc Sun Aug 22 00:06:16 2004
@@ -101,6 +101,9 @@
else if (select && select->quick)
{
DBUG_PRINT("info",("using rr_quick"));
+
+ if (!table->file->inited)
+ table->file->ha_index_init(select->quick->index);
info->read_record=rr_quick;
}
else if (table->sort.record_pointers)
--- 1.133/mysql-test/r/subselect.result Thu Aug 19 21:40:09 2004
+++ 1.134/mysql-test/r/subselect.result Sun Aug 22 00:06:16 2004
@@ -1912,3 +1912,13 @@
1
2
drop table t1,t2;
+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');
+IZAVORGANG_ID
+D0000000001
+drop table t1;
--- 1.115/mysql-test/t/subselect.test Thu Aug 19 21:40:09 2004
+++ 1.116/mysql-test/t/subselect.test Sun Aug 22 00:06:16 2004
@@ -1235,3 +1235,15 @@
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;
+
| Thread |
|---|
| • bk commit into 4.1 tree (hf:1.1997) | holyfoot | 21 Aug |