2 --echo # Bug#36981 -
"innodb crash when selecting for update"
6 # Test 1: Test based on the reproduction test case for this bug.
7 # This query resulted in a crash in InnoDB due to
8 # InnoDB changing from using the index which the push condition
9 # where for to use the clustered index due to "SELECT ... FOR UPDATE".
18 INSERT INTO t1 VALUES (
'3', null);
20 SELECT * FROM t1 WHERE c1=
'3' FOR UPDATE;
25 # Test 2: Extended test case to test that the correct rows are returned.
26 # This test is for ensuring that if InnoDB refuses to accept
27 # the pushed index condition it is still evaluated.
30 CREATE
TABLE t1 (a INT);
31 INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
33 CREATE
TABLE t2 (a INT);
34 INSERT INTO t2 SELECT
A.a + 10*(B.a + 10*C.a) FROM t1
A, t1 B, t1 C;
39 c3 CHAR(200) NOT NULL,
44 SELECT CONCAT(
'c-',1000+t2.a,
'=w'), CONCAT(
'c-',1000+ t2.a,
'=w'),
'filler'
48 SELECT CONCAT(
'c-',1000+t2.a,
'=w'), CONCAT(
'c-',2000+t2.a,
'=w'),
'filler-1'
52 SELECT CONCAT(
'c-',1000+t2.a,
'=w'), CONCAT(
'c-',3000+t2.a,
'=w'),
'filler-2'
56 SELECT c1,c3 FROM t3 WHERE c1 >=
'c-1994=w' and c1 !=
'c-1996=w' FOR UPDATE;
61 --echo # Bug#43360 - Server crash with a simple multi-
table update
65 a CHAR(2) NOT NULL PRIMARY
KEY,
66 b VARCHAR(20) NOT NULL,
71 a CHAR(2) NOT NULL PRIMARY KEY,
72 b VARCHAR(30) NOT NULL,
78 (
'JA',
'Sun Microsystems'),
86 (
'MS',
'United States of America'),
87 (
'IB',
'North America'),
88 (
'GO',
'South America');
90 UPDATE t1,t2 SET t1.b=UPPER(t1.b) WHERE t1.b LIKE 'United%';
92 SELECT * FROM t1
ORDER BY a;
94 SELECT * FROM t2
ORDER BY a;
99 --echo # Bug#40992 - InnoDB: Crash when engine_condition_pushdown is on
103 dummy INT PRIMARY KEY,
108 INSERT INTO t VALUES (1,1,1),(3,3,3),(5,5,5);
110 SELECT * FROM t WHERE a > 2 FOR UPDATE;
115 --echo # Bug#35080 - Innodb crash at mem_block_get_len line 72
119 t1_autoinc INT(11) NOT NULL AUTO_INCREMENT,
120 uuid VARCHAR(36) DEFAULT NULL,
121 PRIMARY KEY (t1_autoinc),
126 t2_autoinc INT(11) NOT NULL AUTO_INCREMENT,
127 uuid VARCHAR(36) DEFAULT NULL,
128 date DATETIME DEFAULT NULL,
129 PRIMARY KEY (t2_autoinc),
134 SELECT t1_autoinc, uuid
136 WHERE (ISNULL(uuid) OR (uuid like
'%-%'));
139 SELECT t2_autoinc, uuid, date
141 WHERE (ISNULL(uuid) OR (LENGTH(uuid) = 36));
143 CREATE PROCEDURE delete_multi (IN uuid CHAR(36))
144 DELETE v1, v2 FROM v1 INNER
JOIN v2
146 WHERE v1.uuid = @uuid;
150 INSERT INTO v1 (uuid) VALUES (@uuid);
151 INSERT INTO v2 (uuid, date) VALUES (@uuid, '2009-09-09');
153 CALL delete_multi(@uuid);
155 DROP procedure delete_multi;
160 --echo # Bug#41996 - multi-
table delete crashes server (InnoDB
table)
169 INSERT INTO t1 VALUES (2, 2);
171 DELETE t1 FROM t1 a, t1 WHERE a.i=t1.b;
176 --echo # Bug#43448 - Server crashes on multi
table delete with Innodb
180 id1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
197 CREATE PROCEDURE insert_data ()
199 DECLARE i1 INT DEFAULT 20;
204 INSERT INTO t1(t) VALUES (i1);
207 INSERT INTO t2(id2, t) VALUES (i1, i2);
210 INSERT INTO t3(id3, t) VALUES (i1, i2);
223 SELECT COUNT(*) FROM t1 WHERE id1 > 10;
224 SELECT COUNT(*) FROM t2 WHERE id2 > 10;
225 SELECT COUNT(*) FROM t3 WHERE id3 > 10;
229 WHERE t1.id1 = t2.id2 AND t2.id2 = t3.id3 AND t1.id1 > 3;
231 SELECT COUNT(*) FROM t1;
232 SELECT COUNT(*) FROM t2;
233 SELECT COUNT(*) FROM t3;
235 DROP PROCEDURE insert_data;
236 DROP
TABLE t1, t2, t3;
239 --echo # Bug#42580 - Innodb
's ORDER BY ..LIMIT returns no rows for
240 --echo # null-safe operator <=> NULL
253 INSERT INTO t1 VALUES('0000-00-00
', '0000-00-00
', '2008-01-04
', '2008-01-05
');
254 INSERT INTO t1 VALUES('2007-05-25
', '2007-05-25
', '2007-05-26
', '2007-05-26
');
255 INSERT INTO t1 VALUES('2008-01-01
', NULL , '2008-01-02
', '2008-01-03
');
256 INSERT INTO t1 VALUES('2008-01-17
', NULL , NULL , '2009-01-29
');
257 INSERT INTO t1 VALUES('2009-01-29
', '2009-01-29
', '2009-01-29
', '2009-01-29
');
260 SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2;
262 SELECT * FROM t1 WHERE c2 <=> NULL ORDER BY c1,c2 LIMIT 2;
268 --echo # Bug#43617 - Innodb returns wrong results with timestamp's range value
269 --echo # in IN clause
270 --echo # (Note: Fixed by patch
for BUG#42580)
274 c1 TIMESTAMP NOT NULL,
282 INSERT INTO t1 VALUES
283 (
'0000-00-00 00:00:00',
'0000-00-00 00:00:00',
'2008-01-04',
'2008-01-05 00:00:00'),
284 (
'1971-01-01 00:00:01',
'1980-01-01 00:00:01',
'2009-01-01',
'2009-01-02 00:00:00'),
285 (
'1999-01-01 00:00:00',
'1999-01-01 00:00:00', NULL, NULL),
286 (
'2007-05-23 09:15:28',
'2007-05-23 09:15:28',
'2007-05-24',
'2007-05-24 09:15:28'),
287 (
'2007-05-27 00:00:00',
'2007-05-25 00:00:00',
'2007-05-26',
'2007-05-26 00:00:00'),
288 (
'2008-01-01 00:00:00', NULL,
'2008-01-02',
'2008-01-03 00:00:00'),
289 (
'2009-01-29 11:11:27',
'2009-01-29 11:11:27',
'2009-01-29',
'2009-01-29 11:11:27'),
290 (
'2038-01-09 03:14:07',
'2038-01-09 03:14:07',
'2009-01-05',
'2009-01-06 00:00:00');
295 WHERE c2 IN (
'1971-01-01 00:00:01',
'2038-01-09 03:14:07')
301 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07')
307 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07')
313 WHERE c2 IN ('1971-01-01 00:00:01','2038-01-09 03:14:07')
314 ORDER BY c2 DESC LIMIT 2;
320 --echo # Bug#43249 - Innodb returns zero time
for the time column
321 --echo # with <=> NULL order by
limit
322 --echo # (Note: Fixed by patch
for BUG#42580)
333 INSERT INTO t1 VALUES(
'8:29:45',NULL,
'2009-02-01');
336 # First time, good results:
337 SELECT * FROM t1 WHERE c2 <=> NULL
ORDER BY c2 LIMIT 2;
340 # Second time, bad results:
341 SELECT * FROM t1 WHERE c2 <=> NULL
ORDER BY c2 LIMIT 2;
346 --echo # BUG#43618: MyISAM&Maria returns wrong results with
'between'
347 --echo # on timestamp
351 ts TIMESTAMP NOT NULL,
356 INSERT INTO t1 VALUES
363 -- disable_result_log
371 --echo # Execute select with invalid timestamp, desc ordering
374 WHERE ts BETWEEN
'0000-00-00' AND
'2010-00-01 00:00:00'
379 --echo # Should use
index condition
383 WHERE ts BETWEEN
'0000-00-00' AND
'2010-00-01 00:00:00'
393 --echo # BUG#49906: Assertion failed - Field_varstring::val_str in field.cc
399 INDEX test_idx USING BTREE (f2,f1(5))
402 INSERT INTO t1 VALUES (
'a',
'c'), (
'b',
'd');
412 --echo # Bug#52660 -
"Perf. regr. using ICP for MyISAM on range queries on
413 --echo # an index containing TEXT"
416 CREATE
TABLE t1 (a INT);
417 INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
419 CREATE
TABLE t2 (a INT);
420 INSERT INTO t2 SELECT A.a + 10*(B.a) FROM t1 A, t1 B;
423 c1 TINYTEXT NOT NULL,
429 -- disable_result_log
436 INSERT INTO t3 SELECT CONCAT(
'c-',1000+t2.a,
'=w'), 1 FROM t2;
438 let
query=SELECT c1 FROM t3 WHERE c1 >=
'c-1004=w' and c1 <=
'c-1006=w' and i1 > 2;
443 DROP
TABLE t1, t2, t3;
446 --echo # Bug#57372
"Multi-table updates and deletes fail when running with ICP
447 --echo # against InnoDB"
460 INSERT INTO t1 VALUES (1, 101), (2, 102), (3, 103), (4, 104), (5, 105);
461 INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
464 SET t1.a = t1.a + 100, t2.b = t1.a + 10
465 WHERE t1.a BETWEEN 2 AND 4 AND t2.a = t1.b - 100;
475 --echo # Bug#52605 -
"Adding LIMIT 1 clause to query with complex range
476 --echo # predicate causes wrong results"
486 INSERT INTO t1 VALUES (1,NULL);
487 INSERT INTO t1 VALUES (2,6);
488 INSERT INTO t1 VALUES (3,NULL);
489 INSERT INTO t1 VALUES (4,6);
490 INSERT INTO t1 VALUES (5,NULL);
491 INSERT INTO t1 VALUES (6,NULL);
492 INSERT INTO t1 VALUES (7,9);
493 INSERT INTO t1 VALUES (8,0);
496 -- disable_result_log
503 WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240
507 EXPLAIN SELECT pk, c1
509 WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240
516 --echo # Bug#42991
"invalid memory access and/or crash when using
517 --echo # index condition pushdown + InnoDB"
520 # Note that you need to run with --valgrind to see the warnings
521 # about invalid memory accesses.
524 c1 TINYTEXT NOT NULL,
530 INSERT INTO t1 VALUES (
'Anastasia', 5);
531 INSERT INTO t1 VALUES (
'Karianne', 4);
534 -- disable_result_log
539 SELECT * FROM t1 WHERE (c1 <=
'6566-06-15' AND c2 <> 3);
541 EXPLAIN SELECT * FROM t1 WHERE (c1 <=
'6566-06-15' AND c2 <> 3);
546 --echo # Bug#56529 -
"Crash due to long semaphore wait in InnoDB
547 --echo # with ICP and subqueries"
551 col_int_nokey INTEGER,
553 col_varchar_key VARCHAR(1),
556 KEY (col_varchar_key, col_int_key)
557 ) stats_persistent=0;
559 INSERT INTO t1 VALUES (NULL,2,'w');
560 INSERT INTO t1 VALUES (7,9,'m');
561 INSERT INTO t1 VALUES (9,3,'m');
562 INSERT INTO t1 VALUES (7,9,'k');
563 INSERT INTO t1 VALUES (4,NULL,'r');
564 INSERT INTO t1 VALUES (2,9,'t');
565 INSERT INTO t1 VALUES (6,3,'j');
566 INSERT INTO t1 VALUES (8,8,'u');
567 INSERT INTO t1 VALUES (NULL,8,'h');
568 INSERT INTO t1 VALUES (5,53,'o');
569 INSERT INTO t1 VALUES (NULL,0,NULL);
570 INSERT INTO t1 VALUES (6,5,'k');
571 INSERT INTO t1 VALUES (188,166,'e');
572 INSERT INTO t1 VALUES (2,3,'
n');
573 INSERT INTO t1 VALUES (1,0,'t');
574 INSERT INTO t1 VALUES (1,1,'c');
575 INSERT INTO t1 VALUES (0,9,'m');
576 INSERT INTO t1 VALUES (9,5,'y');
577 INSERT INTO t1 VALUES (NULL,6,'f');
581 ) stats_persistent=0;
584 SELECT table1.col_int_nokey
585 FROM t1 AS table1 STRAIGHT_JOIN (
586 t1 AS table2 INNER
JOIN t1 AS table3
587 ON table3.col_varchar_key = table2.col_varchar_key)
588 ON table3.col_int_nokey = table1.col_int_key
589 WHERE table3.col_int_key != SOME ( SELECT c1 FROM t2 );
597 --echo # Bug#58243
"RQG test optimizer_subquery causes server crash
598 --echo # when running with ICP"
601 # Test case 1: This test case makes item->const_item() return true
602 # in uses_index_fields_only() for an item tree
603 # containing a subquery. This triggered the subquery
604 # to be pushed down to InnoDB.
614 INSERT INTO t1 VALUES (1,6,7);
621 -- disable_result_log
629 WHERE t1.pk < 317 AND 2 IN (SELECT COUNT(t2.c1)
638 # Test case 2: This test case makes item->used_tables() return 0
639 # in uses_index_fields_only() for an item tree
640 # containg a subquery. This triggered the subquery
641 # to be pushed down to InnoDB.
645 c1 VARCHAR(1) NOT NULL
648 INSERT INTO t1 VALUES (2,
'w');
652 c1 VARCHAR(1) NOT NULL,
653 c2 VARCHAR(1) NOT NULL,
657 INSERT INTO t2 VALUES (8,
'd',
'd');
658 INSERT INTO t2 VALUES (4,
'v',
'v');
661 c1 VARCHAR(1) NOT NULL
664 INSERT INTO t3 VALUES (
'v');
667 -- disable_result_log
677 WHERE EXISTS (SELECT t2.c1
678 FROM (t2 INNER
JOIN t3 ON (t3.c1 = t2.c1))
679 WHERE t2.c2 != t1.c1 AND t2.c2 = (SELECT MIN(t3.c1)
688 --echo # Bug#58015
"Assert in row_sel_field_store_in_mysql_format
689 --echo # when running innodb_mrr_icp test"
692 create
table t1 (a
char(2) charset utf8,b
double, primary key (a(1)),key (b));
693 insert into t1 values (
'',1);
694 select 1 from t1 where b <= 1 and a <>
'';
698 --echo # Bug#59259
"Incorrect rows returned for a correlated subquery
699 --echo # when ICP is on"
702 CREATE
TABLE t1 (pk INTEGER PRIMARY KEY,
i INTEGER NOT NULL) ENGINE=InnoDB;
704 INSERT INTO t1 VALUES (11,0);
705 INSERT INTO t1 VALUES (12,5);
706 INSERT INTO t1 VALUES (15,0);
708 CREATE
TABLE t2 (pk INTEGER PRIMARY KEY,
i INTEGER NOT NULL) ENGINE=InnoDB;
710 INSERT INTO t2 VALUES (11,1);
711 INSERT INTO t2 VALUES (12,2);
712 INSERT INTO t2 VALUES (15,4);
715 WHERE pk IN (SELECT it.pk FROM t2
JOIN t2 AS it ON it.i=it.i WHERE t1.i);
720 --echo # Bug #58816
"Extra temporary duplicate rows in result set when
721 --echo # switching ICP off"
724 # Save optimizer switch setting
725 set @save_optimizer_switch_bug58816= @@optimizer_switch;
733 INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1);
736 -- disable_result_log
741 EXPLAIN SELECT pk, c1 FROM t1 WHERE pk <> 3;
743 SET SESSION optimizer_switch=
'index_condition_pushdown=off';
745 SELECT pk, c1 FROM t1 WHERE pk <> 3;
749 # Restore optimzer switch setting
750 set optimizer_switch= @save_optimizer_switch_bug58816;
753 --echo # Bug#58837: ICP crash or valgrind error due
to uninitialized
763 t2_int
int PRIMARY KEY,
768 INSERT INTO t2 VALUES ();
769 INSERT INTO t1 VALUES ();
773 -- disable_result_log
785 WHERE t1b.t1_int NOT IN
788 WHERE t1b.t1_time LIKE t1b.t1_int
789 OR t1b.t1_time <> t2.t2_int2
798 --eval EXPLAIN $query;
804 --echo # Bug#59186 Wrong results of join when ICP is enabled
809 c1 VARCHAR(3) NOT NULL,
813 INSERT INTO t1 VALUES (1,
'y'),(0,
'or');
817 c1 VARCHAR(3) NOT NULL,
818 c2 VARCHAR(6) NOT NULL,
822 INSERT INTO t2 VALUES (6,
'y',
'RPOYT'),(10,
'm',
'JINQE');
825 -- disable_result_log
832 SELECT c2 FROM t1
JOIN t2 ON t1.c1 = t2.c1
833 WHERE (t2.pk <= 4 AND t1.pk IN (2,1)) OR
834 (t1.pk > 1 AND t2.pk BETWEEN 6 AND 6);
842 --echo # Bug#58838
"Wrong results with HAVING + LIMIT without GROUP BY when
843 --echo # ICP is enabled"
853 INSERT INTO t1 VALUES (1,37),(2,8),(3,-25),(4,NULL),(5,55);
855 SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3
ORDER BY pk LIMIT 0;
856 SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3
ORDER BY pk LIMIT 1;
857 SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3
ORDER BY pk LIMIT 2;
858 SELECT pk FROM t1 WHERE c1 <> 1 HAVING pk = 3
ORDER BY pk LIMIT 5;
863 --echo # Bug#59483
"Crash on INSERT/REPLACE in
864 --echo # rec_convert_dtuple_to_rec_comp with ICP on"
868 pk INTEGER AUTO_INCREMENT PRIMARY KEY,
875 INSERT INTO t1 VALUES
876 (NULL, 4,
'that', 8),
878 (NULL, 6,
'tell', 2);
880 SELECT * FROM t1 WHERE i2 IN (3, 6) LIMIT 2 FOR UPDATE;
881 INSERT INTO t1 (i2) VALUES (1);
886 --echo # Bug #11766678 - 59843:
887 --echo # USING UNINITIALISED VALUE IN USES_INDEX_FIELDS_ONLY
891 col999 FLOAT NOT NULL,
892 COL1000 VARBINARY(179) NOT NULL,
893 col1003 DATE DEFAULT NULL,
894 KEY idx4267 (col1000, col1003)
897 INSERT INTO t1 VALUES (),();
898 SELECT col999 FROM t1 WHERE col1000 =
"3" AND col1003 <=> sysdate();
903 --echo # Bug#11873324
"WRONG RESULT WITH ICP AND STRAIGHT_JOIN"
913 INSERT INTO t1 VALUES (14,NULL), (18,133);
923 INSERT INTO t2 VALUES (1,7,
'f');
925 if (`SELECT UPPER(@@default_storage_engine) =
'INNODB'`)
928 -- disable_result_log
935 # Bug was specific of IN->EXISTS:
936 set @old_opt_switch=@@optimizer_switch;
938 if (`select locate(
'materialization', @@optimizer_switch) > 0`)
940 set optimizer_switch=
'materialization=off';
948 ( SELECT STRAIGHT_JOIN SUBQUERY_t1.pk
949 FROM t1 AS SUBQUERY_t1
950 JOIN t2 AS SUBQUERY_t2
951 ON SUBQUERY_t2.i1 = SUBQUERY_t1.pk
952 WHERE SUBQUERY_t1.i1 > 0
953 OR SUBQUERY_t2.c1 =
'a'
959 set @@optimizer_switch=@old_opt_switch;
963 --echo # Bug#11876420
"MISSING ROW IN RESULT WITH SUBQUERY + IN + XOR +
964 --echo # NULL VALUES AND ICP ENABLED"
970 KEY col_varchar_key (c1)
973 INSERT INTO t1 VALUES (1,
'j'), (0,
'e'), (210,
'f'), (8,
'v'), (7,
'x'),
979 KEY col_varchar_key (c1)
982 INSERT INTO t2 VALUES (8,NULL);
987 KEY col_varchar_key (c1)
990 INSERT INTO t3 VALUES (NULL,'w'), (1,NULL), (2,'d');
993 -- disable_result_log
1000 # Bug was specific of IN->EXISTS:
1001 set @old_opt_switch=@@optimizer_switch;
1003 if (`select locate(
'materialization', @@optimizer_switch) > 0`)
1005 set optimizer_switch=
'materialization=off';
1020 eval EXPLAIN $query;
1023 set @@optimizer_switch=@old_opt_switch;
1024 DROP
TABLE t1, t2, t3;
1027 --echo # Bug#12355958
"FAILING ASSERTION: TRX->LOCK.N_ACTIVE_THRS == 1"
1031 pk INTEGER PRIMARY KEY,
1037 INSERT INTO t1 VALUES (23,5,
'd');
1039 -- disable_query_log
1040 -- disable_result_log
1042 -- enable_result_log
1047 FROM t1 AS a1
JOIN (SELECT * FROM t1 LIMIT 1) AS a2 ON a2.b = a1.b
1048 WHERE a1.a = (SELECT pk FROM t1 LIMIT 1)
1049 AND (a1.a != a2.a OR a1.b IS NULL);
1051 eval EXPLAIN $query;
1054 # Re-run the same query using a view. This will test the code with
1055 # an Item_ref object in the condition tree (note: in order for this
1056 # to trigger the bug the patch for Bug#59696 needs to be applied first).
1058 CREATE VIEW v1 AS SELECT * FROM t1;
1062 FROM v1 AS a1
JOIN (SELECT * FROM v1 LIMIT 1) AS a2 ON a2.b = a1.b
1063 WHERE a1.a = (SELECT pk FROM v1 LIMIT 1)
1064 AND (a1.a != a2.a OR a1.b IS NULL);
1066 eval EXPLAIN $query;
1073 --echo # BUG#12601961
"SEGFAULT IN HANDLER::COMPARE_KEY2"
1074 --echo # BUG#12724899
"SELECT STRAIGHT_JOIN QUERY GIVES 2 DATES VERSUS
1075 --echo # 2 WARNINGS WITH ICP ON"
1079 pk INTEGER NOT NULL,
1080 i1 INTEGER NOT NULL,
1081 c1 VARCHAR(1) NOT NULL,
1085 INSERT INTO t1 VALUES (1,3,
'j'), (20,8,
'e');
1087 -- disable_query_log
1088 -- disable_result_log
1090 -- enable_result_log
1095 FROM t1 AS alias1 STRAIGHT_JOIN t1 AS alias2
1096 ON alias2.pk AND alias2.pk <= alias1.c1
1097 WHERE alias2.pk = 1;
1099 eval EXPLAIN $query;
1105 --echo # BUG#12822678 - 2 MORE ROWS WHEN ICP=ON W/ STRAIGHT_JOIN
1109 i1 INTEGER NOT NULL,
1114 INSERT INTO t1 VALUES (10,1), (17,NULL), (22,NULL);
1117 pk INTEGER NOT NULL,
1118 i1 INTEGER NOT NULL,
1122 INSERT INTO t2 VALUES (4,1);
1124 -- disable_query_log
1125 -- disable_result_log
1128 -- enable_result_log
1132 SELECT t1.d1, t2.pk, t2.i1
1133 FROM t1 STRAIGHT_JOIN t2 ON t2.i1
1134 WHERE t2.pk <> t1.d1 AND t2.pk = 4;
1136 eval EXPLAIN $query;
1142 --echo # BUG#12838420
"DUPLICATE VALUES FOR GROUP-BY COLUMN WHEN JOIN
1143 --echo # BUFFERING IS OFF"
1151 INSERT INTO t1 VALUES (2,3),(3,2),(3,5),(4,6);
1159 INSERT INTO t2 VALUES (0,9),(3,10),(4,6),(6,1),(100,3),(200,5);
1161 -- disable_query_log
1162 -- disable_result_log
1165 -- enable_result_log
1169 SELECT t2.col_int_key AS field1
1170 FROM t2 USE INDEX(col_int_key) STRAIGHT_JOIN t1 ON t2.col_int_key
1171 WHERE t2.pk < 7 AND t2.col_int_key <> 7
1174 set @old_opt_switch=@@optimizer_switch;
1175 # With BNL, a temp table is used for GROUP BY, we don't want this
1176 SET optimizer_switch=
"block_nested_loop=off";
1177 eval EXPLAIN $query;
1180 SET @@optimizer_switch=@old_opt_switch;
1184 --echo # Bug#12976163
"CRASH IN INDEX CONDITION PUSHDOWN CODE AGAINST
1185 --echo # A MYISAM TABLE"
1189 i1 INTEGER NOT NULL,
1193 INSERT INTO t1 VALUES (14,1), (15,2), (16,3);
1196 i1 INTEGER NOT NULL,
1197 i2 INTEGER NOT NULL,
1202 SELECT i1, 10 * i2,
"MySQL" FROM t1;
1206 CREATE PROCEDURE proc1(
id INTEGER)
1211 (SELECT i1, i2, NULL AS a1 FROM t1)
1213 (SELECT i1, i2, c1 AS a1 FROM t2)
1223 DROP PROCEDURE proc1;
1228 --echo # Bug#13655397
"CRASH IN SYNC_THREAD_LEVELS_NONEMPTY_TRX"
1232 i1 INTEGER NOT NULL,
1233 i2 INTEGER NOT NULL,
1237 INSERT INTO t1 VALUES (4,4), (5,5);
1240 pk INTEGER NOT NULL,
1244 INSERT INTO t2 VALUES (1);
1246 -- disable_query_log
1247 -- disable_result_log
1250 -- enable_result_log
1253 CREATE FUNCTION f1() RETURNS INTEGER
1254 RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
1257 SELECT i1, i2 FROM t1 WHERE f1() = 1 AND i1 = 5;
1259 eval EXPLAIN $query;