summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-03-07 14:40:37 +0200
committerunknown <monty@mashka.mysql.fi>2003-03-07 14:40:37 +0200
commit1791e116b48f859746df42c4482aa39eef988944 (patch)
treee4fb25e07ebfe47403d42ac74d2ee8b38cfef27b /mysql-test
parent22c89f8e7f756cec14c9485c4bbc9571382e1d73 (diff)
downloadmariadb-git-1791e116b48f859746df42c4482aa39eef988944.tar.gz
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()
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/join.result4
-rw-r--r--mysql-test/t/join.test24
2 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 39331fc68e4..0c575d7505e 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -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
diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test
index d31db5c4837..6a022e690f2 100644
--- a/mysql-test/t/join.test
+++ b/mysql-test/t/join.test
@@ -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;