Commit f4830634 authored by Sergey Glukhov's avatar Sergey Glukhov

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.
parent 936a2b11
...@@ -2417,4 +2417,42 @@ ENGINE=InnoDB; ...@@ -2417,4 +2417,42 @@ ENGINE=InnoDB;
INSERT INTO t1 VALUES (0, 77, 1, 3); INSERT INTO t1 VALUES (0, 77, 1, 3);
UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25; UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
DROP TABLE t1; DROP TABLE t1;
#
# Bug#50389 Using intersect does not return all rows
#
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 ;
f1 f2 f3 f4 f5
3305175 1221457 0 0 abcdefghijklmnopwrst
3329875 1221457 1382427 0 abcdefghijklmnopwrst
3336022 1221457 0 0 abcdefghijklmnopwrst
3346860 1221457 0 0 abcdefghijklmnopwrst
3772880 1221457 0 0 abcdefghijklmnopwrst
3784744 1221457 1382427 0 abcdefghijklmnopwrst
3796193 1221457 0 0 abcdefghijklmnopwrst
4228206 1221457 0 0 abcdefghijklmnopwrst
4494153 1221457 0 0 abcdefghijklmnopwrst
4559596 1221457 0 0 abcdefghijklmnopwrst
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 ;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge PRIMARY,idx1,idx2 idx2,idx1,PRIMARY 7,60,4 NULL 1 Using intersect(idx2,idx1,PRIMARY); Using where
DROP TABLE t1;
End of 5.1 tests End of 5.1 tests
3304605 1221256 0 0 abcdefghijklmnopwrst
3304606 1221259 0 0 abcdefghijklmnopwrst
3304607 1221260 0 0 asdfghjklzxcvbnm
3304629 1221273 0 0 asdfghjklzxcvbnm
3304630 1221273 0 0 asdfghjklzxcvbnm
3304634 1221259 0 0 asdfghjklzxcvbnm
3304644 1221278 0 0 abcdefghijklmnopwrst
3304648 1221278 0 0 abcdefghijklmnopwrst
3304649 1221278 0 1 asdfghjklzxcvbnm
3304650 1221278 0 0 asdfghjklzxcvbnm
3304651 1221282 0 0 abcdefghijklmnopwrst
3304660 1221287 0 0 asdfghjklzxcvbnm
3304662 1221288 0 0 abcdefghijklmnopwrst
3304663 1221288 0 0 abcdefghijklmnopwrst
3304664 1221290 0 0 abcdefghijklmnopwrst
3304670 1221290 0 0 asdfghjklzxcvbnm
3304671 1221292 0 0 abcdefghijklmnopwrst
3304672 1221287 0 0 asdfghjklzxcvbnm
3304673 1221294 0 0 asdfghjklzxcvbnm
3304674 1221287 0 0 asdfghjklzxcvbnm
3304676 1221296 0 0 abcdefghijklmnopwrst
3304677 1221287 0 0 abcdefghijklmnopwrst
3304678 1221287 0 0 abcdefghijklmnopwrst
3304679 1221297 0 0 asdfghjklzxcvbnm
3304680 1221290 0 0 abcdefghijklmnopwrst
3304681 1221290 0 0 abcdefghijklmnopwrst
3304685 1221300 0 0 asdfghjklzxcvbnm
3304687 1221302 0 0 abcdefghijklmnopwrst
3304688 1221296 1221298 0 abcdefghijklmnopwrst
3304692 1221309 0 0 asdfghjklzxcvbnm
3304694 1221309 0 0 asdfghjklzxcvbnm
3304695 1221290 0 0 abcdefghijklmnopwrst
3304696 1221313 0 0 asdfghjklzxcvbnm
3304701 1221314 0 0 asdfghjklzxcvbnm
3304703 1221313 0 0 abcdefghijklmnopwrst
3304707 1221313 0 0 asdfghjklzxcvbnm
3304709 1221313 0 0 abcdefghijklmnopwrst
3304713 1221314 0 0 abcdefghijklmnopwrst
3304715 1221317 0 0 abcdefghijklmnopwrst
3304717 1221319 0 0 asdfghjklzxcvbnm
3304718 1221320 0 0 abcdefghijklmnopwrst
3304723 1221314 0 0 abcdefghijklmnopwrst
3304724 1221314 0 0 asdfghjklzxcvbnm
3304725 1221300 0 0 asdfghjklzxcvbnm
3304726 1221314 0 0 asdfghjklzxcvbnm
3304730 1221326 0 0 asdfghjklzxcvbnm
3304732 1221328 0 0 asdfghjklzxcvbnm
3304733 1221329 0 0 asdfghjklzxcvbnm
3304745 1221331 0 0 abcdefghijklmnopwrst
3304747 1221300 0 0 abcdefghijklmnopwrst
3304752 1221332 0 0 asdfghjklzxcvbnm
3304756 1221333 0 0 asdfghjklzxcvbnm
3304765 1221336 0 0 asdfghjklzxcvbnm
3304767 1221338 0 0 abcdefghijklmnopwrst
3304769 1221340 0 0 asdfghjklzxcvbnm
3304770 1221328 0 0 asdfghjklzxcvbnm
3304771 1221328 0 0 abcdefghijklmnopwrst
3304773 1221340 0 0 asdfghjklzxcvbnm
3304774 1221340 0 0 abcdefghijklmnopwrst
3304775 1221338 1221342 1 asdfghjklzxcvbnm
3304778 1221345 0 0 asdfghjklzxcvbnm
3304786 1221332 0 0 asdfghjklzxcvbnm
3304787 1221347 0 0 abcdefghijklmnopwrst
3304789 1221347 0 0 asdfghjklzxcvbnm
3304793 1221349 0 0 abcdefghijklmnopwrst
3304794 1221350 0 0 asdfghjklzxcvbnm
3304800 1221290 0 0 asdfghjklzxcvbnm
3304802 1221290 0 0 asdfghjklzxcvbnm
3304803 1221290 0 0 asdfghjklzxcvbnm
3304810 1221356 0 0 asdfghjklzxcvbnm
3304811 1221356 0 0 asdfghjklzxcvbnm
3304821 1221364 0 0 asdfghjklzxcvbnm
3304823 1221365 0 0 asdfghjklzxcvbnm
3304824 1221366 0 0 abcdefghijklmnopwrst
3304825 1221365 0 0 asdfghjklzxcvbnm
3304826 1221367 0 0 asdfghjklzxcvbnm
3304828 1221369 0 0 abcdefghijklmnopwrst
3304829 1221366 1221368 0 asdfghjklzxcvbnm
3304831 1221372 0 0 abcdefghijklmnopwrst
3304832 1221364 1221373 0 abcdefghijklmnopwrst
3304833 1221364 1221371 0 asdfghjklzxcvbnm
3304834 1221364 0 0 abcdefghijklmnopwrst
3304836 1221375 0 0 abcdefghijklmnopwrst
3304837 1221364 0 0 abcdefghijklmnopwrst
3304838 1221364 1221376 0 asdfghjklzxcvbnm
3304840 1221372 0 0 asdfghjklzxcvbnm
3304842 1221372 0 1 abcdefghijklmnopwrst
3304844 1221372 0 0 asdfghjklzxcvbnm
3304845 1221372 0 0 abcdefghijklmnopwrst
3304847 1221382 0 0 abcdefghijklmnopwrst
3304848 1221372 0 0 abcdefghijklmnopwrst
3304849 1221372 0 0 asdfghjklzxcvbnm
3304852 1221364 1221378 0 asdfghjklzxcvbnm
3304853 1221383 0 0 abcdefghijklmnopwrst
3304854 1221384 0 0 asdfghjklzxcvbnm
3304855 1221347 0 0 asdfghjklzxcvbnm
3304858 1221383 0 0 abcdefghijklmnopwrst
3304862 1221386 0 0 abcdefghijklmnopwrst
3304864 1221387 0 0 abcdefghijklmnopwrst
3304867 1221389 0 0 abcdefghijklmnopwrst
3304868 1221390 0 0 asdfghjklzxcvbnm
3304869 1221391 0 0 asdfghjklzxcvbnm
3304871 1221393 0 0 asdfghjklzxcvbnm
3304874 1221395 0 0 abcdefghijklmnopwrst
3304877 1221396 0 0 abcdefghijklmnopwrst
3304879 1221396 0 0 asdfghjklzxcvbnm
3304882 1221398 0 0 abcdefghijklmnopwrst
3304883 1221399 0 0 abcdefghijklmnopwrst
3304884 1221400 0 0 abcdefghijklmnopwrst
3304889 1221405 0 0 abcdefghijklmnopwrst
3304895 1221409 0 0 asdfghjklzxcvbnm
3304899 1221395 0 0 asdfghjklzxcvbnm
3304900 1221395 0 0 asdfghjklzxcvbnm
3304902 1221395 0 0 abcdefghijklmnopwrst
3304903 1221395 0 0 asdfghjklzxcvbnm
3304924 1221414 0 0 abcdefghijklmnopwrst
3304925 1221415 0 0 asdfghjklzxcvbnm
3304935 1221416 0 0 asdfghjklzxcvbnm
3304936 1221418 0 0 asdfghjklzxcvbnm
3304944 1221419 0 0 abcdefghijklmnopwrst
3304959 1221427 0 0 asdfghjklzxcvbnm
3304963 1221415 0 0 asdfghjklzxcvbnm
3304964 1221428 0 0 asdfghjklzxcvbnm
3304965 1221429 0 0 abcdefghijklmnopwrst
3304978 1221433 0 0 abcdefghijklmnopwrst
3304986 1221437 0 0 asdfghjklzxcvbnm
3304988 1221439 0 0 asdfghjklzxcvbnm
3304994 1221441 0 0 asdfghjklzxcvbnm
3304996 1221442 0 0 asdfghjklzxcvbnm
3304998 1221443 0 0 asdfghjklzxcvbnm
3305003 1221446 0 0 abcdefghijklmnopwrst
3305008 1221433 0 0 abcdefghijklmnopwrst
3305009 1221447 0 0 asdfghjklzxcvbnm
3305012 1221447 0 0 asdfghjklzxcvbnm
3305013 1221449 0 0 abcdefghijklmnopwrst
3305015 1221451 0 0 asdfghjklzxcvbnm
3305019 1221453 0 0 asdfghjklzxcvbnm
3305023 1221449 0 0 asdfghjklzxcvbnm
3305026 1221456 0 0 abcdefghijklmnopwrst
3305028 1221457 0 0 asdfghjklzxcvbnm
3305032 1221449 0 0 asdfghjklzxcvbnm
3305037 1221453 0 0 asdfghjklzxcvbnm
3305040 1221451 0 0 asdfghjklzxcvbnm
3305061 1221446 0 0 abcdefghijklmnopwrst
3305175 1221457 0 0 abcdefghijklmnopwrst
3305304 1221453 0 0 abcdefghijklmnopwrst
3305308 1221453 0 1 abcdefghijklmnopwrst
3305333 1221457 1221577 0 asdfghjklzxcvbnm
3305335 1221453 0 0 asdfghjklzxcvbnm
3305354 1221457 0 1 asdfghjklzxcvbnm
3306089 1221442 0 0 abcdefghijklmnopwrst
3306090 1221442 0 0 abcdefghijklmnopwrst
3306092 1221442 0 0 asdfghjklzxcvbnm
3306345 1221366 0 0 asdfghjklzxcvbnm
3306349 1221366 0 0 asdfghjklzxcvbnm
3306419 1221364 1221371 0 asdfghjklzxcvbnm
3307390 1221453 0 0 abcdefghijklmnopwrst
3308002 1221416 1221417 0 abcdefghijklmnopwrst
3308331 1221366 1222821 0 abcdefghijklmnopwrst
3309991 1221347 0 0 asdfghjklzxcvbnm
3311917 1221287 0 0 abcdefghijklmnopwrst
3311937 1221287 0 0 abcdefghijklmnopwrst
3311945 1221287 0 0 asdfghjklzxcvbnm
3311955 1221287 0 0 abcdefghijklmnopwrst
3311961 1221287 0 0 asdfghjklzxcvbnm
3311963 1221287 0 1 asdfghjklzxcvbnm
3311968 1221287 0 0 asdfghjklzxcvbnm
3311974 1221287 0 1 abcdefghijklmnopwrst
3311976 1221287 0 1 abcdefghijklmnopwrst
3311981 1221287 0 1 abcdefghijklmnopwrst
3311985 1221287 0 1 asdfghjklzxcvbnm
3312014 1221287 0 0 abcdefghijklmnopwrst
3312018 1221287 0 1 abcdefghijklmnopwrst
3312025 1221287 0 0 abcdefghijklmnopwrst
3312027 1221287 0 0 abcdefghijklmnopwrst
3312030 1221287 0 0 abcdefghijklmnopwrst
3313755 1221288 0 0 abcdefghijklmnopwrst
3313767 1221288 0 0 asdfghjklzxcvbnm
3314668 1221290 0 0 asdfghjklzxcvbnm
3314670 1221290 0 0 abcdefghijklmnopwrst
3323440 1221338 0 0 abcdefghijklmnopwrst
3323736 1221338 0 0 asdfghjklzxcvbnm
3323739 1221338 0 0 asdfghjklzxcvbnm
3324077 1221290 0 0 asdfghjklzxcvbnm
3324081 1221290 0 0 abcdefghijklmnopwrst
3324082 1221290 0 0 abcdefghijklmnopwrst
3324639 1221457 1221563 1 asdfghjklzxcvbnm
3326180 1221287 0 0 abcdefghijklmnopwrst
3326204 1221287 0 0 asdfghjklzxcvbnm
3326945 1221457 1221563 1 asdfghjklzxcvbnm
3328393 1221364 1221373 0 asdfghjklzxcvbnm
3328966 1221287 0 0 abcdefghijklmnopwrst
3329875 1221457 1382427 0 abcdefghijklmnopwrst
3333449 1221278 1231113 0 abcdefghijklmnopwrst
3336022 1221457 0 0 abcdefghijklmnopwrst
3340069 1221364 1221373 0 abcdefghijklmnopwrst
3340073 1221364 1221373 0 abcdefghijklmnopwrst
3340563 1221290 0 0 asdfghjklzxcvbnm
3341553 1221453 0 0 abcdefghijklmnopwrst
3345868 1221287 0 0 asdfghjklzxcvbnm
3345873 1221287 0 0 abcdefghijklmnopwrst
3345879 1221287 0 0 asdfghjklzxcvbnm
3346860 1221457 0 0 abcdefghijklmnopwrst
3347053 1221287 0 0 asdfghjklzxcvbnm
3347109 1221287 0 1 abcdefghijklmnopwrst
3350589 1221372 1236415 0 abcdefghijklmnopwrst
3350594 1221372 1236415 1 asdfghjklzxcvbnm
3353871 1221457 0 0 asdfghjklzxcvbnm
3354727 1221364 1221373 0 abcdefghijklmnopwrst
3355270 1221393 0 1 abcdefghijklmnopwrst
3357638 1221287 0 0 asdfghjklzxcvbnm
3357644 1221287 0 0 abcdefghijklmnopwrst
3357648 1221287 0 0 abcdefghijklmnopwrst
3357651 1221287 0 0 asdfghjklzxcvbnm
3357661 1221287 0 0 abcdefghijklmnopwrst
3357678 1221287 0 0 abcdefghijklmnopwrst
3357697 1221287 0 0 asdfghjklzxcvbnm
3357737 1221287 0 0 asdfghjklzxcvbnm
3357744 1221287 0 0 abcdefghijklmnopwrst
3357754 1221287 0 1 asdfghjklzxcvbnm
3357760 1221287 0 1 abcdefghijklmnopwrst
3357774 1221287 0 1 abcdefghijklmnopwrst
3357779 1221287 0 0 abcdefghijklmnopwrst
3357796 1221287 0 0 asdfghjklzxcvbnm
3357814 1221287 0 0 asdfghjklzxcvbnm
3357833 1221287 0 1 asdfghjklzxcvbnm
3357835 1221287 0 0 abcdefghijklmnopwrst
3357840 1221287 0 1 asdfghjklzxcvbnm
3357842 1221287 0 0 abcdefghijklmnopwrst
3357845 1221287 0 1 abcdefghijklmnopwrst
3357849 1221287 0 1 abcdefghijklmnopwrst
3357852 1221287 0 0 abcdefghijklmnopwrst
3358935 1221443 0 1 abcdefghijklmnopwrst
3358967 1221443 0 1 abcdefghijklmnopwrst
3359181 1221256 0 0 abcdefghijklmnopwrst
3360512 1221319 0 0 asdfghjklzxcvbnm
3362004 1221287 0 0 abcdefghijklmnopwrst
3362009 1221287 0 1 abcdefghijklmnopwrst
3362358 1221287 0 0 asdfghjklzxcvbnm
3363214 1221287 0 0 abcdefghijklmnopwrst
3363238 1221287 0 1 asdfghjklzxcvbnm
3363616 1221287 0 1 asdfghjklzxcvbnm
3363631 1221287 0 0 asdfghjklzxcvbnm
3364281 1221287 0 0 abcdefghijklmnopwrst
3365900 1221347 0 0 asdfghjklzxcvbnm
3365901 1221347 0 0 asdfghjklzxcvbnm
3365906 1221347 0 0 asdfghjklzxcvbnm
3365907 1221347 0 0 asdfghjklzxcvbnm
3365910 1221347 0 0 abcdefghijklmnopwrst
3365936 1221347 0 0 abcdefghijklmnopwrst
3367846 1221287 0 0 abcdefghijklmnopwrst
3368011 1221428 0 0 abcdefghijklmnopwrst
3369882 1221300 0 0 asdfghjklzxcvbnm
3370856 1221443 0 0 asdfghjklzxcvbnm
3370861 1221443 1221445 0 abcdefghijklmnopwrst
3375327 1221443 0 0 abcdefghijklmnopwrst
3375333 1221443 1221445 0 abcdefghijklmnopwrst
3376219 1221453 0 1 abcdefghijklmnopwrst
3376228 1221453 0 0 abcdefghijklmnopwrst
3376238 1221453 0 0 asdfghjklzxcvbnm
3376243 1221453 0 0 abcdefghijklmnopwrst
3376248 1221453 0 1 abcdefghijklmnopwrst
3376254 1221453 0 0 abcdefghijklmnopwrst
3376263 1221453 0 0 abcdefghijklmnopwrst
3376272 1221453 0 1 asdfghjklzxcvbnm
3376281 1221453 0 0 asdfghjklzxcvbnm
3376290 1221453 0 0 abcdefghijklmnopwrst
3376296 1221453 0 1 abcdefghijklmnopwrst
3376301 1221453 0 0 asdfghjklzxcvbnm
3376350 1221453 0 0 asdfghjklzxcvbnm
3379002 1221453 0 0 abcdefghijklmnopwrst
3379015 1221453 0 0 asdfghjklzxcvbnm
3379025 1221453 0 0 abcdefghijklmnopwrst
3379032 1221453 0 0 asdfghjklzxcvbnm
3380181 1221372 1245650 0 asdfghjklzxcvbnm
3380186 1221372 1245650 0 abcdefghijklmnopwrst
3380190 1221372 1245650 0 asdfghjklzxcvbnm
3380195 1221372 1245650 0 abcdefghijklmnopwrst
3380202 1221372 1245650 0 asdfghjklzxcvbnm
3380683 1221287 0 0 asdfghjklzxcvbnm
3382317 1221453 0 0 abcdefghijklmnopwrst
3382417 1221287 0 0 asdfghjklzxcvbnm
3383523 1221338 0 1 abcdefghijklmnopwrst
3387213 1221287 0 0 abcdefghijklmnopwrst
3388139 1221453 0 0 asdfghjklzxcvbnm
3398039 1221443 1251164 0 abcdefghijklmnopwrst
3401835 1221453 0 0 asdfghjklzxcvbnm
3412582 1221443 1255886 0 asdfghjklzxcvbnm
3412583 1221443 1255886 0 asdfghjklzxcvbnm
3413795 1221443 1255886 0 asdfghjklzxcvbnm
3413813 1221443 1256258 0 asdfghjklzxcvbnm
3420306 1221453 0 0 asdfghjklzxcvbnm
3420354 1221453 0 0 asdfghjklzxcvbnm
3425653 1221443 0 0 abcdefghijklmnopwrst
3425658 1221443 0 0 asdfghjklzxcvbnm
3431409 1221453 0 0 asdfghjklzxcvbnm
3432510 1221443 1262320 0 asdfghjklzxcvbnm
3432513 1221443 1262320 0 asdfghjklzxcvbnm
3444444 1221443 1262320 0 abcdefghijklmnopwrst
3445447 1221287 0 1 asdfghjklzxcvbnm
3448662 1221338 0 0 asdfghjklzxcvbnm
3450032 1221347 0 0 abcdefghijklmnopwrst
3450259 1221453 0 0 abcdefghijklmnopwrst
3452176 1221453 0 0 asdfghjklzxcvbnm
3459239 1221347 0 0 asdfghjklzxcvbnm
3463196 1221347 0 0 abcdefghijklmnopwrst
3468759 1221453 0 0 abcdefghijklmnopwrst
3470988 1221457 0 0 asdfghjklzxcvbnm
3477116 1221287 0 0 asdfghjklzxcvbnm
3477639 1221372 1277136 0 abcdefghijklmnopwrst
3477656 1221372 1277136 0 asdfghjklzxcvbnm
3488071 1221256 1238964 0 abcdefghijklmnopwrst
3488079 1221256 0 0 asdfghjklzxcvbnm
3488108 1221256 0 1 asdfghjklzxcvbnm
3507126 1221287 0 1 asdfghjklzxcvbnm
3511898 1221347 0 0 asdfghjklzxcvbnm
3521780 1221453 0 0 abcdefghijklmnopwrst
3536908 1221287 0 0 abcdefghijklmnopwrst
3544231 1221329 0 1 asdfghjklzxcvbnm
3545379 1221329 1298955 0 abcdefghijklmnopwrst
3545384 1221329 1298955 0 abcdefghijklmnopwrst
3545387 1221329 1298955 0 abcdefghijklmnopwrst
3545389 1221329 1298955 1 abcdefghijklmnopwrst
3545398 1221329 1298955 1 abcdefghijklmnopwrst
3555715 1221287 0 0 asdfghjklzxcvbnm
3563557 1221329 1298955 0 abcdefghijklmnopwrst
3564322 1221338 0 0 asdfghjklzxcvbnm
3565475 1221453 0 0 abcdefghijklmnopwrst
3577588 1221287 0 0 asdfghjklzxcvbnm
3600047 1221453 0 0 abcdefghijklmnopwrst
3600062 1221453 0 0 asdfghjklzxcvbnm
3600071 1221453 0 0 abcdefghijklmnopwrst
3600080 1221453 0 1 abcdefghijklmnopwrst
3600086 1221453 0 0 asdfghjklzxcvbnm
3600091 1221453 0 1 abcdefghijklmnopwrst
3600097 1221453 0 0 asdfghjklzxcvbnm
3600103 1221453 0 0 asdfghjklzxcvbnm
3600106 1221453 0 0 abcdefghijklmnopwrst
3600113 1221453 0 0 abcdefghijklmnopwrst
3600119 1221453 0 0 asdfghjklzxcvbnm
3600124 1221453 0 0 abcdefghijklmnopwrst
3600144 1221453 0 0 asdfghjklzxcvbnm
3600152 1221453 0 0 asdfghjklzxcvbnm
3600165 1221453 0 0 asdfghjklzxcvbnm
3610561 1221287 0 0 abcdefghijklmnopwrst
3617030 1221329 0 0 asdfghjklzxcvbnm
3628347 1221443 1327098 0 abcdefghijklmnopwrst
3628348 1221443 1327098 0 abcdefghijklmnopwrst
3628646 1221443 0 0 asdfghjklzxcvbnm
3633673 1221372 1328838 0 abcdefghijklmnopwrst
3648489 1221443 0 0 asdfghjklzxcvbnm
3648490 1221443 0 0 asdfghjklzxcvbnm
3648534 1221443 1333827 0 asdfghjklzxcvbnm
3653046 1221329 1298955 0 asdfghjklzxcvbnm
3662680 1221287 0 0 asdfghjklzxcvbnm
3699529 1221288 0 0 asdfghjklzxcvbnm
3706659 1221453 0 0 asdfghjklzxcvbnm
3723399 1221287 0 1 asdfghjklzxcvbnm
3749934 1221278 0 0 abcdefghijklmnopwrst
3761370 1221443 1371176 0 asdfghjklzxcvbnm
3765884 1221443 1333827 0 abcdefghijklmnopwrst
3772880 1221457 0 0 abcdefghijklmnopwrst
3779574 1221457 1372998 1 abcdefghijklmnopwrst
3784656 1221457 1372998 1 abcdefghijklmnopwrst
3784700 1221457 1372998 1 abcdefghijklmnopwrst
3784744 1221457 1382427 0 abcdefghijklmnopwrst
3796187 1221457 1382427 1 abcdefghijklmnopwrst
3796193 1221457 0 0 abcdefghijklmnopwrst
3817277 1221457 1382427 0 asdfghjklzxcvbnm
3828282 1221457 0 0 abcdefghijklmnopwrst
3828297 1221457 0 0 abcdefghijklmnopwrst
3828300 1221457 0 0 abcdefghijklmnopwrst
3833022 1221287 0 0 asdfghjklzxcvbnm
3856380 1221457 1395359 0 asdfghjklzxcvbnm
3856391 1221457 0 0 asdfghjklzxcvbnm
3861413 1221256 0 0 abcdefghijklmnopwrst
3864734 1221393 0 1 abcdefghijklmnopwrst
3868051 1221329 0 0 abcdefghijklmnopwrst
3868059 1221329 0 0 abcdefghijklmnopwrst
3869088 1221329 0 0 abcdefghijklmnopwrst
3878669 1221329 1298955 0 asdfghjklzxcvbnm
3878684 1221329 1298955 0 asdfghjklzxcvbnm
3881785 1221287 0 0 abcdefghijklmnopwrst
3882333 1221287 0 0 asdfghjklzxcvbnm
3882389 1221287 0 0 abcdefghijklmnopwrst
3908680 1221372 1245650 0 asdfghjklzxcvbnm
3908690 1221372 1245650 0 asdfghjklzxcvbnm
3908697 1221372 1245650 0 abcdefghijklmnopwrst
3911434 1221453 0 0 abcdefghijklmnopwrst
3911446 1221453 0 0 asdfghjklzxcvbnm
3911448 1221453 0 0 abcdefghijklmnopwrst
3911489 1221453 0 0 abcdefghijklmnopwrst
3917384 1221453 0 0 abcdefghijklmnopwrst
3939602 1221457 0 1 asdfghjklzxcvbnm
3962210 1221453 0 0 asdfghjklzxcvbnm
3963734 1221457 0 0 asdfghjklzxcvbnm
3977364 1221287 0 0 asdfghjklzxcvbnm
3981725 1221453 0 0 abcdefghijklmnopwrst
4042952 1221453 0 0 abcdefghijklmnopwrst
4042953 1221453 0 0 abcdefghijklmnopwrst
4042958 1221453 0 0 abcdefghijklmnopwrst
4042960 1221453 0 1 abcdefghijklmnopwrst
4042965 1221453 0 0 asdfghjklzxcvbnm
4066893 1221453 0 1 abcdefghijklmnopwrst
4066896 1221453 0 0 abcdefghijklmnopwrst
4066900 1221453 0 0 abcdefghijklmnopwrst
4066908 1221453 0 0 abcdefghijklmnopwrst
4066912 1221453 0 0 asdfghjklzxcvbnm
4066915 1221453 0 0 asdfghjklzxcvbnm
4066919 1221453 0 0 abcdefghijklmnopwrst
4066924 1221453 0 0 asdfghjklzxcvbnm
4066929 1221453 0 0 abcdefghijklmnopwrst
4066934 1221453 0 0 asdfghjklzxcvbnm
4066941 1221453 0 0 abcdefghijklmnopwrst
4066946 1221453 0 0 asdfghjklzxcvbnm
4066955 1221453 0 0 abcdefghijklmnopwrst
4116291 1221433 1487238 0 asdfghjklzxcvbnm
4116295 1221433 1487238 0 abcdefghijklmnopwrst
4116450 1221433 1487238 0 abcdefghijklmnopwrst
4121149 1221287 0 0 asdfghjklzxcvbnm
4137325 1221453 0 0 abcdefghijklmnopwrst
4149051 1221287 0 0 abcdefghijklmnopwrst
4162347 1221287 0 0 abcdefghijklmnopwrst
4164485 1221457 0 1 asdfghjklzxcvbnm
4174706 1221457 0 0 abcdefghijklmnopwrst
4178645 1221457 0 0 abcdefghijklmnopwrst
4180122 1221457 1382427 0 asdfghjklzxcvbnm
4180925 1221457 1382427 0 asdfghjklzxcvbnm
4186417 1221457 0 0 abcdefghijklmnopwrst
4189624 1221457 0 1 asdfghjklzxcvbnm
4203132 1221453 0 0 asdfghjklzxcvbnm
4228206 1221457 0 0 abcdefghijklmnopwrst
4278829 1221453 0 0 abcdefghijklmnopwrst
4326422 1221453 0 0 abcdefghijklmnopwrst
4337061 1221287 0 0 abcdefghijklmnopwrst
4379354 1221287 0 0 abcdefghijklmnopwrst
4404901 1221457 0 0 abcdefghijklmnopwrst
4494153 1221457 0 0 abcdefghijklmnopwrst
4535721 1221287 0 0 asdfghjklzxcvbnm
4559596 1221457 0 0 abcdefghijklmnopwrst
4617751 1221393 0 0 abcdefghijklmnopwrst
...@@ -663,4 +663,35 @@ UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25; ...@@ -663,4 +663,35 @@ UPDATE t1 SET d = 0 WHERE b = 77 AND c = 25;
DROP TABLE t1; 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 --echo End of 5.1 tests
...@@ -8349,6 +8349,7 @@ int QUICK_ROR_INTERSECT_SELECT::get_next() ...@@ -8349,6 +8349,7 @@ int QUICK_ROR_INTERSECT_SELECT::get_next()
if ((error= quick->get_next())) if ((error= quick->get_next()))
DBUG_RETURN(error); DBUG_RETURN(error);
} }
quick->file->position(quick->record);
} }
memcpy(last_rowid, quick->file->ref, head->file->ref_length); memcpy(last_rowid, quick->file->ref, head->file->ref_length);
last_rowid_count= 1; last_rowid_count= 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment