mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Fixed bug mdev-5635.
After constant row substitution some field items become constant items. The range analyzer should take into account this fact when looking for ranges.
This commit is contained in:
@@ -1538,3 +1538,14 @@ a
|
||||
3
|
||||
4
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# MDEV-5635: join of a const table with non-const tables
|
||||
#
|
||||
CREATE TABLE t1 (a varchar(3) NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES ('foo');
|
||||
CREATE TABLE t2 (b varchar(3), c varchar(3), INDEX(b)) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES ('bar', 'bar'),( 'qux', 'qux');
|
||||
SELECT STRAIGHT_JOIN * FROM t1, t2 AS t2_1, t2 AS t2_2
|
||||
WHERE t2_2.c = t2_1.c AND t2_2.b = t2_1.b AND ( a IS NULL OR t2_1.c = a );
|
||||
a b c b c
|
||||
DROP TABLE t1,t2;
|
||||
|
Reference in New Issue
Block a user