diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2008-10-24 10:50:59 -0200 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2008-10-24 10:50:59 -0200 |
commit | 463c837c3aaa5c85e8024463bf247a926932de5d (patch) | |
tree | f22f6d527d9486dd9fee61ed406841efe147658b /mysql-test | |
parent | 03300dc1a44f37e33b4c93c1a82babe90ccf28a8 (diff) | |
parent | d5202ddd314385374a0afcf61343b7de7f53b192 (diff) | |
download | mariadb-git-463c837c3aaa5c85e8024463bf247a926932de5d.tar.gz |
Merge from mysql-5.0-bugteam into mysql-5.1-bugteam
mysql-test/r/partition_not_windows.result:
Update warning number due to new errors appearing earlier
in the list.
mysql-test/r/partition_symlink.result:
Update warning number due to new errors appearing earlier
in the list.
mysql-test/r/symlink.result:
Update warning number due to new errors appearing earlier
in the list.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/group_by.result | 30 | ||||
-rw-r--r-- | mysql-test/r/partition_not_windows.result | 4 | ||||
-rw-r--r-- | mysql-test/r/partition_symlink.result | 4 | ||||
-rw-r--r-- | mysql-test/r/symlink.result | 10 | ||||
-rw-r--r-- | mysql-test/t/group_by.test | 29 |
5 files changed, 68 insertions, 9 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 30c4d1e4ca1..12e1460e128 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -1274,6 +1274,36 @@ tt 41 SET sql_mode=@save_sql_mode; DROP TABLE t1, t2; +# +# BUG#38072: Wrong result: HAVING not observed in a query with aggregate +# +CREATE TABLE t1 ( +pk int(11) NOT NULL AUTO_INCREMENT, +int_nokey int(11) NOT NULL, +int_key int(11) NOT NULL, +varchar_key varchar(1) NOT NULL, +varchar_nokey varchar(1) NOT NULL, +PRIMARY KEY (pk), +KEY int_key (int_key), +KEY varchar_key (varchar_key) +); +INSERT INTO t1 VALUES +(1,5,5, 'h','h'), +(2,1,1, '{','{'), +(3,1,1, 'z','z'), +(4,8,8, 'x','x'), +(5,7,7, 'o','o'), +(6,3,3, 'p','p'), +(7,9,9, 'c','c'), +(8,0,0, 'k','k'), +(9,6,6, 't','t'), +(10,0,0,'c','c'); +explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible HAVING +SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar'; +X +drop table t1; End of 5.0 tests CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a), diff --git a/mysql-test/r/partition_not_windows.result b/mysql-test/r/partition_not_windows.result index c0247babb50..cf1fec98b07 100644 --- a/mysql-test/r/partition_not_windows.result +++ b/mysql-test/r/partition_not_windows.result @@ -24,8 +24,8 @@ data directory='/not/existing' index directory='/not/existing' ); Warnings: -Warning 1616 <DATA DIRECTORY> option ignored -Warning 1616 <INDEX DIRECTORY> option ignored +Warning 1618 <DATA DIRECTORY> option ignored +Warning 1618 <INDEX DIRECTORY> option ignored show create table t2; Table Create Table t2 CREATE TABLE `t2` ( diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result index 00c9f5b3f01..894966f6c53 100644 --- a/mysql-test/r/partition_symlink.result +++ b/mysql-test/r/partition_symlink.result @@ -101,8 +101,8 @@ data directory='/not/existing' index directory='/not/existing' ); Warnings: -Warning 1616 <DATA DIRECTORY> option ignored -Warning 1616 <INDEX DIRECTORY> option ignored +Warning 1618 <DATA DIRECTORY> option ignored +Warning 1618 <INDEX DIRECTORY> option ignored show create table t2; Table Create Table t2 CREATE TABLE `t2` ( diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index df4aa343f1f..7711517fe5e 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -79,7 +79,7 @@ drop database mysqltest; create table t1 (a int not null) engine=myisam; alter table t1 data directory="MYSQLTEST_VARDIR/tmp"; Warnings: -Warning 1616 <DATA DIRECTORY> option ignored +Warning 1618 <DATA DIRECTORY> option ignored show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -88,7 +88,7 @@ t1 CREATE TABLE `t1` ( alter table t1 add b int; alter table t1 data directory="MYSQLTEST_VARDIR/log"; Warnings: -Warning 1616 <DATA DIRECTORY> option ignored +Warning 1618 <DATA DIRECTORY> option ignored show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -97,7 +97,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 alter table t1 index directory="MYSQLTEST_VARDIR/log"; Warnings: -Warning 1616 <INDEX DIRECTORY> option ignored +Warning 1618 <INDEX DIRECTORY> option ignored show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -164,8 +164,8 @@ ERROR HY000: Can't create/write to file 'TEST_DIR/master-data_var/t1.MYI' (Errco SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE='NO_DIR_IN_CREATE'; CREATE TABLE t1(a INT) DATA DIRECTORY='MYSQLTEST_VARDIR/tmp' INDEX DIRECTORY='MYSQLTEST_VARDIR/tmp'; Warnings: -Warning 1616 <DATA DIRECTORY> option ignored -Warning 1616 <INDEX DIRECTORY> option ignored +Warning 1618 <DATA DIRECTORY> option ignored +Warning 1618 <INDEX DIRECTORY> option ignored DROP TABLE t1; SET @@SQL_MODE=@OLD_SQL_MODE; End of 5.1 tests diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index d02e8e10a2b..36aef981f21 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -940,6 +940,35 @@ select (select sum(outr.a + t1.a) from t1 limit 1) as tt from t1 as outr order b SET sql_mode=@save_sql_mode; DROP TABLE t1, t2; +--echo # +--echo # BUG#38072: Wrong result: HAVING not observed in a query with aggregate +--echo # +CREATE TABLE t1 ( + pk int(11) NOT NULL AUTO_INCREMENT, + int_nokey int(11) NOT NULL, + int_key int(11) NOT NULL, + varchar_key varchar(1) NOT NULL, + varchar_nokey varchar(1) NOT NULL, + PRIMARY KEY (pk), + KEY int_key (int_key), + KEY varchar_key (varchar_key) +); +INSERT INTO t1 VALUES +(1,5,5, 'h','h'), +(2,1,1, '{','{'), +(3,1,1, 'z','z'), +(4,8,8, 'x','x'), +(5,7,7, 'o','o'), +(6,3,3, 'p','p'), +(7,9,9, 'c','c'), +(8,0,0, 'k','k'), +(9,6,6, 't','t'), +(10,0,0,'c','c'); + +explain SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar'; +SELECT COUNT(varchar_key) AS X FROM t1 WHERE pk = 8 having 'foo'='bar'; +drop table t1; + --echo End of 5.0 tests # Bug #21174: Index degrades sort performance and # optimizer does not honor IGNORE INDEX. |