mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
Merging
This commit is contained in:
commit
8854eeda26
3 changed files with 24 additions and 0 deletions
|
@ -1907,6 +1907,15 @@ a
|
|||
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
|
||||
CREATE TABLE `t1` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`));
|
||||
CREATE TABLE `t2` ( `aid` int(11) NOT NULL default '0', `bid` int(11) NOT NULL default '0', PRIMARY KEY (`aid`,`bid`));
|
||||
insert into t1 values (1,1),(1,2),(2,1),(2,2);
|
||||
|
|
|
@ -1226,6 +1226,18 @@ select a,b from t1 where match(b) against ('Ball') > 0;
|
|||
select a from t2 where a in (select a from t1 where match(b) against ('Ball') > 0);
|
||||
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;
|
||||
|
||||
#
|
||||
# Optimized IN with compound index
|
||||
#
|
||||
|
|
|
@ -101,6 +101,9 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table,
|
|||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue