File: derived_cond_pushdown_innodb.result

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (39 lines) | stat: -rw-r--r-- 1,968 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# MDEV-33010: Crash when pushing condition with CHARSET()/COERCIBILITY()
#             into derived table
#
CREATE TABLE t1 (c1 BIGINT, KEY (c1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (c2 DOUBLE UNSIGNED);
INSERT INTO t2 VALUES (1);
SET optimizer_switch='derived_merge=off';
EXPLAIN EXTENDED
SELECT dt1_c1 FROM
(SELECT c1 AS dt1_c1 FROM t1) AS dt1
JOIN
(SELECT 1 AS dt2_c2 FROM t2) AS dt2
ON CHARSET(dt2_c2) BETWEEN dt1_c1 AND dt1_c1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	PRIMARY	<derived3>	system	NULL	NULL	NULL	NULL	1	100.00	
1	PRIMARY	<derived2>	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
3	DERIVED	t2	system	NULL	NULL	NULL	NULL	1	100.00	
2	DERIVED	t1	ref	c1	c1	9	const	1	100.00	Using where; Using index
Warnings:
Warning	1292	Truncated incorrect DECIMAL value: 'binary'
Note	1003	/* select#1 */ select `dt1`.`dt1_c1` AS `dt1_c1` from (/* select#2 */ select `test`.`t1`.`c1` AS `dt1_c1` from `test`.`t1` where <cache>(charset(1)) between `test`.`t1`.`c1` and `test`.`t1`.`c1`) `dt1` where <cache>(charset(1)) between `dt1`.`dt1_c1` and `dt1`.`dt1_c1`
EXPLAIN EXTENDED
SELECT dt1_c1 FROM
(SELECT c1 AS dt1_c1 FROM t1) AS dt1
JOIN
(SELECT 1 AS dt2_c2 FROM t2) AS dt2
ON COERCIBILITY(dt2_c2) BETWEEN dt1_c1 AND dt1_c1;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	PRIMARY	<derived3>	system	NULL	NULL	NULL	NULL	1	100.00	
1	PRIMARY	<derived2>	ALL	NULL	NULL	NULL	NULL	2	100.00	Using where
3	DERIVED	t2	system	NULL	NULL	NULL	NULL	1	100.00	
2	DERIVED	t1	ref	c1	c1	9	const	1	100.00	Using where; Using index
Warnings:
Note	1003	/* select#1 */ select `dt1`.`dt1_c1` AS `dt1_c1` from (/* select#2 */ select `test`.`t1`.`c1` AS `dt1_c1` from `test`.`t1` where <cache>(coercibility(1)) between `test`.`t1`.`c1` and `test`.`t1`.`c1`) `dt1` where <cache>(coercibility(1)) between `dt1`.`dt1_c1` and `dt1`.`dt1_c1`
SET optimizer_switch=DEFAULT;
DROP TABLE t1, t2;
# End of 10.4 tests