summaryrefslogtreecommitdiff
path: root/mysql-test/r/ps.result
diff options
context:
space:
mode:
authorunknown <sanja@montyprogram.com>2012-05-25 10:29:53 +0300
committerunknown <sanja@montyprogram.com>2012-05-25 10:29:53 +0300
commitf45784c8503d0bbe77f3aec351fc87ff536b19be (patch)
treeed6e0b6cc29483f0707c7ce7bb3abe666384fc9d /mysql-test/r/ps.result
parentd56f5dae1ef60468dd7497453bcdca9b653922ca (diff)
downloadmariadb-git-f45784c8503d0bbe77f3aec351fc87ff536b19be.tar.gz
Fix of LP bug#992380 + revise fix_fields about missing with_subselect collection
The problem is that some fix_fields do not call Item_func::fix_fields and do not collect with subselect_information.
Diffstat (limited to 'mysql-test/r/ps.result')
-rw-r--r--mysql-test/r/ps.result56
1 files changed, 56 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index b3f4ad017d3..72558324b50 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3040,3 +3040,59 @@ id select_type table type possible_keys key key_len ref rows Extra
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests.
+#
+# LP bug#1001500 Crash on the second execution of the PS for
+# a query with degenerated conjunctive condition
+# (see also mysql bug#12582849)
+#
+CREATE TABLE t1 (
+pk INTEGER AUTO_INCREMENT,
+col_int_nokey INTEGER,
+col_int_key INTEGER,
+col_varchar_key VARCHAR(1),
+col_varchar_nokey VARCHAR(1),
+PRIMARY KEY (pk),
+KEY (col_int_key),
+KEY (col_varchar_key, col_int_key)
+);
+INSERT INTO t1 (
+col_int_key, col_int_nokey,
+col_varchar_key, col_varchar_nokey
+) VALUES
+(4, 2, 'v', 'v'),
+(62, 150, 'v', 'v');
+CREATE TABLE t2 (
+pk INTEGER AUTO_INCREMENT,
+col_int_nokey INTEGER,
+col_int_key INTEGER,
+col_varchar_key VARCHAR(1),
+col_varchar_nokey VARCHAR(1),
+PRIMARY KEY (pk),
+KEY (col_int_key),
+KEY (col_varchar_key, col_int_key)
+);
+INSERT INTO t2 (
+col_int_key, col_int_nokey,
+col_varchar_key, col_varchar_nokey
+) VALUES
+(8, NULL, 'x', 'x'),
+(7, 8, 'd', 'd');
+PREPARE stmt FROM '
+SELECT
+ ( SELECT MAX( SQ1_alias2 .col_int_nokey ) AS SQ1_field1
+ FROM ( t2 AS SQ1_alias1 RIGHT JOIN t1 AS SQ1_alias2
+ ON ( SQ1_alias2.col_varchar_key = SQ1_alias1.col_varchar_nokey )
+ )
+ WHERE SQ1_alias2.pk < alias1.col_int_nokey OR alias1.pk
+ ) AS field1
+FROM ( t1 AS alias1 JOIN t2 AS alias2 ON alias2.pk )
+GROUP BY field1
+';
+EXECUTE stmt;
+field1
+150
+EXECUTE stmt;
+field1
+150
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1, t2;