diff options
author | unknown <monty@mashka.mysql.fi> | 2003-02-07 15:06:23 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-02-07 15:06:23 +0200 |
commit | 8602b726a1d85aa0300d08dfea4ad8002fee9070 (patch) | |
tree | 5cace589571553163ae26ddaaf6402dfe33ea6ac /mysql-test | |
parent | db4f836be2ba117f8e588634a7852101bc8eec13 (diff) | |
parent | def31a51354b28e288b7b52a58c891183bfde855 (diff) | |
download | mariadb-git-8602b726a1d85aa0300d08dfea4ad8002fee9070.tar.gz |
Merge work:/my/mysql-4.0 into mashka.mysql.fi:/home/my/mysql-4.0
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/distinct.result | 2 | ||||
-rw-r--r-- | mysql-test/r/func_group.result | 4 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/r/join.result | 30 | ||||
-rw-r--r-- | mysql-test/r/order_by.result | 15 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 56 | ||||
-rw-r--r-- | mysql-test/t/func_group.test | 2 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 2 | ||||
-rw-r--r-- | mysql-test/t/join.test | 25 | ||||
-rw-r--r-- | mysql-test/t/order_by.test | 3 | ||||
-rw-r--r-- | mysql-test/t/show_check.test | 35 |
11 files changed, 166 insertions, 10 deletions
diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 020d6c6534f..5f4f7cced1e 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -77,7 +77,6 @@ NULL NULL 10 VMT select id+0 as a,max(id),concat(facility) as b from t1 group by a order by b desc,a; a max(id) b -NULL NULL NULL 10 10 VMT 9 9 SRV 8 8 RV @@ -90,6 +89,7 @@ NULL NULL NULL 1 1 /L -1 -1 0 0 +NULL NULL NULL select id >= 0 and id <= 5 as grp,count(*) from t1 group by grp; grp count(*) NULL 1 diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 8263df36105..b129beaac81 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -42,8 +42,8 @@ insert into t1 values (null,null,''); select count(distinct a),count(distinct grp) from t1; count(distinct a) count(distinct grp) 6 3 -select sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1; -sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) +select sum(all a),count(all a),avg(all a),std(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1; +sum(all a) count(all a) avg(all a) std(all a) bit_or(all a) bit_and(all a) min(all a) max(all a) min(all c) max(all c) 21 6 3.5000 1.7078 7 0 1 6 E select grp, sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; grp sum(a) count(a) avg(a) std(a) bit_or(a) bit_and(a) min(a) max(a) min(c) max(c) diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 9d50a6a86e9..828bd2bab83 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -290,7 +290,7 @@ select * from t1; id val drop table t1; create table t1 (a integer) type=innodb; -begin; +start transaction; rename table t1 to t2; create table t1 (b integer) type=innodb; insert into t1 values (1); diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result index ff608825b9c..ddea0ac1a57 100644 --- a/mysql-test/r/join.result +++ b/mysql-test/r/join.result @@ -1,4 +1,34 @@ drop table if exists t1,t2,t3; +CREATE TABLE t1 (S1 INT); +CREATE TABLE t2 (S1 INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 JOIN t2; +S1 S1 +1 2 +SELECT * FROM t1 INNER JOIN t2; +S1 S1 +1 2 +SELECT * from t1 JOIN t2 USING (S1); +S1 S1 +SELECT * FROM t1 INNER JOIN t2 USING (S1); +S1 S1 +SELECT * from t1 CROSS JOIN t2; +S1 S1 +1 2 +SELECT * from t1 LEFT JOIN t2 USING(S1); +S1 S1 +1 NULL +SELECT * from t1 LEFT JOIN t2 ON(t2.S1=2); +S1 S1 +1 2 +SELECT * from t1 RIGHT JOIN t2 USING(S1); +S1 S1 +NULL 2 +SELECT * from t1 RIGHT JOIN t2 ON(t1.S1=1); +S1 S1 +1 2 +drop table t1,t2; create table t1 (id int primary key); create table t2 (id int); insert into t1 values (75); diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 48773bfa916..9238d9eafcb 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -304,7 +304,7 @@ a b c 1 NULL b explain select * from t1 where a >= 1 and a < 3 and b >0 order by a desc,b desc; table type possible_keys key key_len ref rows Extra -t1 range a a 9 NULL 8 Using where; Using index; Using filesort +t1 range a a 9 NULL 8 Using where; Using index explain select * from t1 where a = 2 and b >0 order by a desc,b desc; table type possible_keys key key_len ref rows Extra t1 range a a 9 NULL 5 Using where; Using index @@ -320,7 +320,18 @@ table type possible_keys key key_len ref rows Extra t1 range a a 9 NULL 5 Using where; Using index explain select * from t1 where a = 2 and b < 2 order by a desc,b desc; table type possible_keys key key_len ref rows Extra -t1 range a a 9 NULL 2 Using where; Using index; Using filesort +t1 range a a 9 NULL 2 Using where; Using index +explain select * from t1 where a = 1 order by b desc; +table type possible_keys key key_len ref rows Extra +t1 ref a a 4 const 5 Using where; Using index +select * from t1 where a = 1 order by b desc; +a b c +1 3 b +1 1 b +1 1 b +1 1 NULL +1 NULL b +1 NULL NULL alter table t1 modify b int not null, modify c varchar(10) not null; explain select * from t1 order by a, b, c; table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 2c32d766a38..fa2f381d905 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -156,6 +156,62 @@ f double(5,0) YES NULL h float(3,2) YES NULL i float(3,0) YES NULL drop table t1; +create table t1 ( +type_bool bool not null, +type_tiny tinyint not null auto_increment primary key, +type_short smallint(3), +type_mediumint mediumint, +type_bigint bigint, +type_decimal decimal(5,2), +type_numeric numeric(5,2), +empty_char char(0), +type_char char(2), +type_varchar varchar(10), +type_timestamp timestamp not null, +type_date date not null, +type_time time not null, +type_datetime datetime not null, +type_year year, +type_enum enum ('red', 'green', 'blue'), +type_set enum ('red', 'green', 'blue'), +type_tinyblob tinyblob, +type_blob blob, +type_medium_blob mediumblob, +type_long_blob longblob, +index(type_short) +) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `type_bool` tinyint(1) NOT NULL default '0', + `type_tiny` tinyint(4) NOT NULL auto_increment, + `type_short` smallint(3) default NULL, + `type_mediumint` mediumint(9) default NULL, + `type_bigint` bigint(20) default NULL, + `type_decimal` decimal(5,2) default NULL, + `type_numeric` decimal(5,2) default NULL, + `empty_char` char(0) default NULL, + `type_char` char(2) default NULL, + `type_varchar` varchar(10) default NULL, + `type_timestamp` timestamp(14) NOT NULL, + `type_date` date NOT NULL default '0000-00-00', + `type_time` time NOT NULL default '00:00:00', + `type_datetime` datetime NOT NULL default '0000-00-00 00:00:00', + `type_year` year(4) default NULL, + `type_enum` enum('red','green','blue') default NULL, + `type_set` enum('red','green','blue') default NULL, + `type_tinyblob` tinyblob, + `type_blob` blob, + `type_medium_blob` mediumblob, + `type_long_blob` longblob, + PRIMARY KEY (`type_tiny`), + KEY `type_short` (`type_short`) +) TYPE=MyISAM MIN_ROWS=10 MAX_ROWS=100 AVG_ROW_LENGTH=10 PACK_KEYS=1 CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=FIXED COMMENT='test' +insert into t1 (type_timestamp) values ("2003-02-07 10:00:01"); +select * from t1; +type_bool type_tiny type_short type_mediumint type_bigint type_decimal type_numeric empty_char type_char type_varchar type_timestamp type_date type_time type_datetime type_year type_enum type_set type_tinyblob type_blob type_medium_blob type_long_blob +0 1 NULL NULL NULL NULL NULL NULL NULL NULL 20030207100001 0000-00-00 00:00:00 0000-00-00 00:00:00 NULL NULL NULL NULL NULL NULL NULL +drop table t1; create table t1 (c decimal, d double, f float, r real); show columns from t1; Field Type Null Key Default Extra diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 04a2ff68a92..1915c2172ad 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -21,7 +21,7 @@ select count(distinct a),count(distinct grp) from t1; insert into t1 values (null,null,''); select count(distinct a),count(distinct grp) from t1; -select sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1; +select sum(all a),count(all a),avg(all a),std(all a),bit_or(all a),bit_and(all a),min(all a),max(all a),min(all c),max(all c) from t1; select grp, sum(a),count(a),avg(a),std(a),bit_or(a),bit_and(a),min(a),max(a),min(c),max(c) from t1 group by grp; select grp, sum(a)+count(a)+avg(a)+std(a)+bit_or(a)+bit_and(a)+min(a)+max(a)+min(c)+max(c) as sum from t1 group by grp; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index eb5b0c9efd2..250b68a3845 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -167,7 +167,7 @@ drop table t1; # create table t1 (a integer) type=innodb; -begin; +start transaction; rename table t1 to t2; create table t1 (b integer) type=innodb; insert into t1 values (1); diff --git a/mysql-test/t/join.test b/mysql-test/t/join.test index f58281af003..70980f656ab 100644 --- a/mysql-test/t/join.test +++ b/mysql-test/t/join.test @@ -1,7 +1,30 @@ # +# Initialization +drop table if exists t1,t2,t3; + +# +# Test different join syntaxes +# + +CREATE TABLE t1 (S1 INT); +CREATE TABLE t2 (S1 INT); +INSERT INTO t1 VALUES (1); +INSERT INTO t2 VALUES (2); +SELECT * FROM t1 JOIN t2; +SELECT * FROM t1 INNER JOIN t2; +SELECT * from t1 JOIN t2 USING (S1); +SELECT * FROM t1 INNER JOIN t2 USING (S1); +SELECT * from t1 CROSS JOIN t2; +SELECT * from t1 LEFT JOIN t2 USING(S1); +SELECT * from t1 LEFT JOIN t2 ON(t2.S1=2); +SELECT * from t1 RIGHT JOIN t2 USING(S1); +SELECT * from t1 RIGHT JOIN t2 ON(t1.S1=1); +drop table t1,t2; + +# # This failed for lia Perminov # -drop table if exists t1,t2,t3; + create table t1 (id int primary key); create table t2 (id int); diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 0ee6f901aae..8291a475d5e 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -227,7 +227,8 @@ explain select * from t1 where a = 2 and (b is null or b > 0) order by a desc,b desc; explain select * from t1 where a = 2 and b > 0 order by a desc,b desc; explain select * from t1 where a = 2 and b < 2 order by a desc,b desc; - +explain select * from t1 where a = 1 order by b desc; +select * from t1 where a = 1 order by b desc; # # Test things when we don't have NULL keys # diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 5e10ebf23a3..ba6fa930e22 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -80,6 +80,41 @@ create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), show columns from t1; drop table t1; +# +# Do a create table that tries to cover all types and options +# +create table t1 ( +type_bool bool not null, +type_tiny tinyint not null auto_increment primary key, +type_short smallint(3), +type_mediumint mediumint, +type_bigint bigint, +type_decimal decimal(5,2), +type_numeric numeric(5,2), +empty_char char(0), +type_char char(2), +type_varchar varchar(10), +type_timestamp timestamp not null, +type_date date not null, +type_time time not null, +type_datetime datetime not null, +type_year year, +type_enum enum ('red', 'green', 'blue'), +type_set enum ('red', 'green', 'blue'), +type_tinyblob tinyblob, +type_blob blob, +type_medium_blob mediumblob, +type_long_blob longblob, +index(type_short) +) AVG_ROW_LENGTH=10 CHECKSUM=1 COMMENT="test" TYPE=MYISAM MIN_ROWS=10 MAX_ROWS=100 PACK_KEYS=1 DELAY_KEY_WRITE=1 ROW_FORMAT=fixed CHARSET=latin1; + +# Not tested above: RAID_# UNION INSERT_METHOD DATA DIRECTORY INDEX DIRECTORY +show create table t1; +insert into t1 (type_timestamp) values ("2003-02-07 10:00:01"); +select * from t1; +drop table t1; + + # Check auto conversions of types create table t1 (c decimal, d double, f float, r real); |