diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2012-06-18 22:38:11 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2012-06-18 22:38:11 +0400 |
commit | 90fbd8b22b4b84cdc027fed26012efd87c2b6737 (patch) | |
tree | 48eff1dbe5fd3468e7583d1748de6b5cc8b16c92 /mysql-test/t/ps.test | |
parent | db6dbadb5a9edd9e93398b6afe8e3196eb768e0a (diff) | |
parent | 64aa1fcb1354ffa24999a1512258c897116b0928 (diff) | |
download | mariadb-git-90fbd8b22b4b84cdc027fed26012efd87c2b6737.tar.gz |
Merge 5.2->5.3
Diffstat (limited to 'mysql-test/t/ps.test')
-rw-r--r-- | mysql-test/t/ps.test | 75 |
1 files changed, 71 insertions, 4 deletions
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 2f101b4e42f..89b9f4642e9 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -276,11 +276,11 @@ deallocate prepare Stmt1; # also check that statement names are in right charset. set names utf8; -prepare `ü` from 'select 1234'; -execute `ü` ; +prepare `ü` from 'select 1234'; +execute `ü` ; set names latin1; -execute `ü`; -deallocate prepare `ü`; +execute `ü`; +deallocate prepare `ü`; set names default; @@ -3117,6 +3117,71 @@ DROP TABLE t1; --echo End of 5.1 tests. +--echo # +--echo # LP bug#1001500 Crash on the second execution of the PS for +--echo # a query with degenerated conjunctive condition +--echo # (see also mysql bug#12582849) +--echo # + +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; +EXECUTE stmt; + +DEALLOCATE PREPARE stmt; + +DROP TABLE t1, t2; + # # restoring of the Item tree in BETWEEN with dates # @@ -3243,3 +3308,5 @@ GROUP BY c1, c2; EXECUTE s1; DEALLOCATE PREPARE s1; + +--echo # End of 5.3 tests |