Browse Source

Test case for bug lp:905353

The bug itself is fixed by the patch for bug lp:908269.
pull/843/head
unknown 14 years ago
parent
commit
f6cdddf51f
  1. 9
      mysql-test/r/subselect.result
  2. 9
      mysql-test/r/subselect_no_mat.result
  3. 9
      mysql-test/r/subselect_no_opts.result
  4. 9
      mysql-test/r/subselect_no_scache.result
  5. 9
      mysql-test/r/subselect_no_semijoin.result
  6. 11
      mysql-test/t/subselect.test

9
mysql-test/r/subselect.result

@ -5994,5 +5994,14 @@ SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1;
1
NULL
drop table t1,t2,t3;
#
# LP BUG#905353 Wrong non-empty result with a constant table,
# aggregate function in subquery, MyISAM or Aria
#
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT a FROM t1 WHERE ( SELECT MIN(a) = 100 );
a
drop table t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;

9
mysql-test/r/subselect_no_mat.result

@ -5993,6 +5993,15 @@ SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1;
1
NULL
drop table t1,t2,t3;
#
# LP BUG#905353 Wrong non-empty result with a constant table,
# aggregate function in subquery, MyISAM or Aria
#
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT a FROM t1 WHERE ( SELECT MIN(a) = 100 );
a
drop table t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
set optimizer_switch=default;

9
mysql-test/r/subselect_no_opts.result

@ -5989,6 +5989,15 @@ SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1;
1
NULL
drop table t1,t2,t3;
#
# LP BUG#905353 Wrong non-empty result with a constant table,
# aggregate function in subquery, MyISAM or Aria
#
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT a FROM t1 WHERE ( SELECT MIN(a) = 100 );
a
drop table t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
set @optimizer_switch_for_subselect_test=null;

9
mysql-test/r/subselect_no_scache.result

@ -6000,6 +6000,15 @@ SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1;
1
NULL
drop table t1,t2,t3;
#
# LP BUG#905353 Wrong non-empty result with a constant table,
# aggregate function in subquery, MyISAM or Aria
#
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT a FROM t1 WHERE ( SELECT MIN(a) = 100 );
a
drop table t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
set optimizer_switch=default;

9
mysql-test/r/subselect_no_semijoin.result

@ -5989,6 +5989,15 @@ SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1;
1
NULL
drop table t1,t2,t3;
#
# LP BUG#905353 Wrong non-empty result with a constant table,
# aggregate function in subquery, MyISAM or Aria
#
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT a FROM t1 WHERE ( SELECT MIN(a) = 100 );
a
drop table t1;
# return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
set @optimizer_switch_for_subselect_test=null;

11
mysql-test/t/subselect.test

@ -5078,6 +5078,17 @@ SELECT ( SELECT b FROM t2 WHERE b = a OR rand() * 0) FROM t1;
drop table t1,t2,t3;
--echo #
--echo # LP BUG#905353 Wrong non-empty result with a constant table,
--echo # aggregate function in subquery, MyISAM or Aria
--echo #
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
SELECT a FROM t1 WHERE ( SELECT MIN(a) = 100 );
drop table t1;
--echo # return optimizer switch changed in the beginning of this test
set optimizer_switch=@subselect_tmp;
Loading…
Cancel
Save