diff options
author | unknown <msvensson@neptunus.(none)> | 2005-09-23 09:18:56 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2005-09-23 09:18:56 +0200 |
commit | 129300f13dbc77d77c0f25aebcf70e209041c609 (patch) | |
tree | c8bd72147c7a879a6bd64b822d50e5b84a315c56 /mysql-test/t | |
parent | abda6dc69fa6d1fb75cf5754eb71edd10baae12c (diff) | |
parent | 727f0b8a1f2fdc3f458f6b5da5ebe3cc73620403 (diff) | |
download | mariadb-git-129300f13dbc77d77c0f25aebcf70e209041c609.tar.gz |
Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
client/mysqltest.c:
Auto merged
myisam/myisamchk.c:
Auto merged
mysql-test/t/func_group.test:
Auto merged
mysql-test/t/loaddata.test:
Auto merged
mysql-test/t/type_decimal.test:
Auto merged
mysql-test/t/union.test:
Auto merged
sql/item_sum.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
mysql-test/r/func_group.result:
Manual merge
mysql-test/r/loaddata.result:
Manual merge
mysql-test/r/type_decimal.result:
Manual merge
mysql-test/r/union.result:
Manual merge
sql/field_conv.cc:
aborting fix for 7589
sql/opt_sum.cc:
Manual merge
sql/sql_load.cc:
Manual merge
sql/sql_yacc.yy:
Aborting fix for 11553
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/func_group.test | 69 | ||||
-rw-r--r-- | mysql-test/t/loaddata.test | 27 | ||||
-rw-r--r-- | mysql-test/t/type_decimal.test | 10 | ||||
-rw-r--r-- | mysql-test/t/union.test | 8 |
4 files changed, 106 insertions, 8 deletions
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index fb9470c16dd..19596c1b55a 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -539,6 +539,75 @@ INSERT INTO t1 VALUES SELECT MAX(id) FROM t1 WHERE id < 3 AND a=2 AND b=6; DROP TABLE t1; +# +# Bug #12882 min/max inconsistent on empty table +# + +create table t1m (a int) engine=myisam; +create table t1i (a int) engine=innodb; +create table t2m (a int) engine=myisam; +create table t2i (a int) engine=innodb; +insert into t2m values (5); +insert into t2i values (5); + +# test with MyISAM +select min(a) from t1m; +select min(7) from t1m; +select min(7) from DUAL; +explain select min(7) from t2m join t1m; +select min(7) from t2m join t1m; + +select max(a) from t1m; +select max(7) from t1m; +select max(7) from DUAL; +explain select max(7) from t2m join t1m; +select max(7) from t2m join t1m; + +select 1, min(a) from t1m where a=99; +select 1, min(a) from t1m where 1=99; +select 1, min(1) from t1m where a=99; +select 1, min(1) from t1m where 1=99; + +select 1, max(a) from t1m where a=99; +select 1, max(a) from t1m where 1=99; +select 1, max(1) from t1m where a=99; +select 1, max(1) from t1m where 1=99; + +# test with InnoDB +select min(a) from t1i; +select min(7) from t1i; +select min(7) from DUAL; +explain select min(7) from t2i join t1i; +select min(7) from t2i join t1i; + +select max(a) from t1i; +select max(7) from t1i; +select max(7) from DUAL; +explain select max(7) from t2i join t1i; +select max(7) from t2i join t1i; + +select 1, min(a) from t1i where a=99; +select 1, min(a) from t1i where 1=99; +select 1, min(1) from t1i where a=99; +select 1, min(1) from t1i where 1=99; + +select 1, max(a) from t1i where a=99; +select 1, max(a) from t1i where 1=99; +select 1, max(1) from t1i where a=99; +select 1, max(1) from t1i where 1=99; + +# mixed MyISAM/InnoDB test +explain select count(*), min(7), max(7) from t1m, t1i; +select count(*), min(7), max(7) from t1m, t1i; + +explain select count(*), min(7), max(7) from t1m, t2i; +select count(*), min(7), max(7) from t1m, t2i; + +explain select count(*), min(7), max(7) from t2m, t1i; +select count(*), min(7), max(7) from t2m, t1i; + +drop table t1m, t1i, t2m, t2i; + # End of 4.1 tests # diff --git a/mysql-test/t/loaddata.test b/mysql-test/t/loaddata.test index fe6828916a3..54309e45c7e 100644 --- a/mysql-test/t/loaddata.test +++ b/mysql-test/t/loaddata.test @@ -31,6 +31,33 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated select * from t1; drop table t1; + +# +# Bug #12053 LOAD DATA INFILE ignores NO_AUTO_VALUE_ON_ZERO setting +# +SET @OLD_SQL_MODE=@@SQL_MODE, @@SQL_MODE=NO_AUTO_VALUE_ON_ZERO; +create table t1(id integer not null auto_increment primary key); +insert into t1 values(0); +disable_query_log; +eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' from t1; +delete from t1; +eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1; +enable_query_log; +select * from t1; +--exec rm $MYSQL_TEST_DIR/var/tmp/t1 + +disable_query_log; +eval SELECT * INTO OUTFILE '$MYSQL_TEST_DIR/var/tmp/t1' +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n' +FROM t1; +delete from t1; +eval load data infile '$MYSQL_TEST_DIR/var/tmp/t1' into table t1 +FIELDS TERMINATED BY '' OPTIONALLY ENCLOSED BY '' LINES TERMINATED BY '\r\n'; +enable_query_log; +select * from t1; +--exec rm $MYSQL_TEST_DIR/var/tmp/t1 +SET @@SQL_MODE=@OLD_SQL_MODE; + # End of 4.1 tests # diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 44032fde46f..1f6310cb819 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -268,6 +268,16 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000 select * from t1; drop table t1; +# +# Bug #7589: a problem with update from column +# + +create table t1(a decimal(10,5), b decimal(10,1)); +insert into t1 values(123.12345, 123.12345); +update t1 set b=a; +select * from t1; +drop table t1; + # End of 4.1 tests # diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index d4b0c1746af..daa83ef0fa4 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -443,14 +443,6 @@ create table t1 SELECT b from t2 UNION select tx from t2; select * from t1; show create table t1; drop table t1,t2; -create table t1 (d decimal(10,1)); -create table t2 (d decimal(10,9)); -insert into t1 values ("100000000.0"); -insert into t2 values ("1.23456780"); -create table t3 select * from t2 union select * from t1; -select * from t3; -show create table t3; -drop table t1,t2,t3; create table t1 select 1 union select -1; select * from t1; show create table t1; |