mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#50389 Using intersect does not return all rows
In process of record search it is not taken into account that inital quick->file->ref value could be inapplicable to range interval. After proper row is found this value is stored into the record buffer and later the record is filtered out at condition evaluation stage. The fix is store a refernce of found row to the handler ref field. mysql-test/r/innodb_mysql.result: test case mysql-test/std_data/intersect-bug50389.tsv: test case mysql-test/t/innodb_mysql.test: test case sql/opt_range.cc: store a refernce of found row to the handler ref field.
This commit is contained in:
@ -663,4 +663,35 @@ UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#50389 Using intersect does not return all rows
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (
|
||||
f1 INT(10) NOT NULL,
|
||||
f2 INT(10),
|
||||
f3 INT(10),
|
||||
f4 TINYINT(4),
|
||||
f5 VARCHAR(50),
|
||||
PRIMARY KEY (f1),
|
||||
KEY idx1 (f2,f5,f4),
|
||||
KEY idx2 (f2,f4)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
LOAD DATA INFILE '../../std_data/intersect-bug50389.tsv' INTO TABLE t1;
|
||||
|
||||
SELECT * FROM t1 WHERE f1 IN
|
||||
(3305028,3353871,3772880,3346860,4228206,3336022,
|
||||
3470988,3305175,3329875,3817277,3856380,3796193,
|
||||
3784744,4180925,4559596,3963734,3856391,4494153)
|
||||
AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
|
||||
|
||||
EXPLAIN SELECT * FROM t1 WHERE f1 IN
|
||||
(3305028,3353871,3772880,3346860,4228206,3336022,
|
||||
3470988,3305175,3329875,3817277,3856380,3796193,
|
||||
3784744,4180925,4559596,3963734,3856391,4494153)
|
||||
AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user