mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed an unlikely optimizer bug that casued a core dump in pt_range.cc::sel_cmp()
mysql-test/r/join.result: Test of range optimizer bug mysql-test/t/join.test: Test of range optimizer bug sql/sql_rename.cc: Added missing DEBUG_PRINT()
This commit is contained in:
@ -37,3 +37,7 @@ COUNT(t1.Title)
|
||||
t1_id t2_id type cost_unit min_value max_value t3_id item_id id name
|
||||
22 1 Percent Cost 100 -1 6 291 1 s1
|
||||
23 1 Percent Cost 100 -1 21 291 1 s1
|
||||
rate_code base_rate
|
||||
cust 20
|
||||
rate_code base_rate
|
||||
cust 20
|
||||
|
@ -219,3 +219,27 @@ CREATE TABLE t2 (
|
||||
INSERT INTO t2 VALUES (1,'s1'),(2,'s2'),(3,'s3'),(4,'s4'),(5,'s5');
|
||||
select t1.*, t2.* from t1, t2 where t2.id=t1.t2_id limit 2;
|
||||
drop table t1,t2;
|
||||
|
||||
#
|
||||
# Bug in range optimiser with MAYBE_KEY
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (
|
||||
siteid varchar(25) NOT NULL default '',
|
||||
emp_id varchar(30) NOT NULL default '',
|
||||
rate_code varchar(10) default NULL,
|
||||
UNIQUE KEY site_emp (siteid,emp_id),
|
||||
KEY siteid (siteid)
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust');
|
||||
CREATE TABLE t2 (
|
||||
siteid varchar(25) NOT NULL default '',
|
||||
rate_code varchar(10) NOT NULL default '',
|
||||
base_rate float NOT NULL default '0',
|
||||
PRIMARY KEY (siteid,rate_code),
|
||||
FULLTEXT KEY rate_code (rate_code)
|
||||
) TYPE=MyISAM;
|
||||
INSERT INTO t2 VALUES ('rivercats','cust',20);
|
||||
SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats';
|
||||
SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith';
|
||||
drop table t1,t2;
|
||||
|
Reference in New Issue
Block a user