diff options
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/analyse.result | 6 | ||||
-rw-r--r-- | mysql-test/r/bdb.result | 56 | ||||
-rw-r--r-- | mysql-test/r/bigint.result | 2 | ||||
-rw-r--r-- | mysql-test/r/connect.result | 20 | ||||
-rw-r--r-- | mysql-test/r/create.result | 91 | ||||
-rw-r--r-- | mysql-test/r/csv.result | 47 | ||||
-rw-r--r-- | mysql-test/r/ctype_cp932_binlog.result | 17 | ||||
-rw-r--r-- | mysql-test/r/federated.result | 27 | ||||
-rw-r--r-- | mysql-test/r/func_gconcat.result | 4 | ||||
-rw-r--r-- | mysql-test/r/func_sapdb.result | 4 | ||||
-rw-r--r-- | mysql-test/r/gis.result | 6 | ||||
-rw-r--r-- | mysql-test/r/join_nested.result | 64 | ||||
-rw-r--r-- | mysql-test/r/myisam.result | 18 | ||||
-rw-r--r-- | mysql-test/r/mysqldump.result | 11 | ||||
-rw-r--r-- | mysql-test/r/ndb_basic.result | 4 | ||||
-rw-r--r-- | mysql-test/r/read_only.result | 43 | ||||
-rw-r--r-- | mysql-test/r/select.result | 40 | ||||
-rw-r--r-- | mysql-test/r/sp.result | 42 | ||||
-rw-r--r-- | mysql-test/r/type_newdecimal.result | 30 | ||||
-rw-r--r-- | mysql-test/r/update.result | 8 | ||||
-rw-r--r-- | mysql-test/r/user_var.result | 11 | ||||
-rw-r--r-- | mysql-test/r/view.result | 54 |
22 files changed, 551 insertions, 54 deletions
diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 59c75c0f313..f4e547dbc66 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -107,7 +107,7 @@ insert into t1 values(1.1); insert into t1 values(2.2); select * from t1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype -test.t1.df 1.1 2.2 8 8 0 0 1.650000000 0.302500000 ENUM('1.1','2.2') NOT NULL +test.t1.df 1.1 2.2 13 13 0 0 1.65000 0.55000 ENUM('1.1','2.2') NOT NULL drop table t1; create table t1 (d double); insert into t1 values (100000); @@ -138,6 +138,6 @@ insert into t2 values (1, 'USA'),(2,'India'), (3,'Finland'); select product, sum(profit),avg(profit) from t1 group by product with rollup procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype test.t1.product Computer TV 2 8 0 0 4.2500 NULL ENUM('Computer','Phone','TV') NOT NULL -sum(profit) 10 6900 2 4 0 0 1946 2868 ENUM('10','275','600','6900') NOT NULL -avg(profit) 10.0000 1380.0000 7 9 0 0 394.6875 570.2003 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL +sum(profit) 10 6900 11 11 0 0 1946.2500 2867.6719 ENUM('10','275','600','6900') NOT NULL +avg(profit) 10.0000 1380.0000 16 16 0 0 394.68750000 570.20033144 ENUM('10.0000','68.7500','120.0000','1380.0000') NOT NULL drop table t1,t2; diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 2bba44d36e9..5cdf9612300 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -1584,8 +1584,6 @@ g 10 h 10 i 10 alter table t1 modify v varchar(300), drop key v, drop key v_2, add key v (v); -Warnings: -Warning 1071 Specified key was too long; max key length is 255 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1594,7 +1592,7 @@ t1 CREATE TABLE `t1` ( `t` text, KEY `c` (`c`), KEY `t` (`t`(10)), - KEY `v` (`v`(255)) + KEY `v` (`v`) ) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1 select count(*) from t1 where v='a'; count(*) @@ -1616,19 +1614,19 @@ count(*) 9 explain select count(*) from t1 where v='a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where explain select count(*) from t1 where v like 'a%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range v v 258 NULL # Using where +1 SIMPLE t1 range v v 303 NULL # Using where explain select count(*) from t1 where v between 'a' and 'a '; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a ' and 'b\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where explain select * from t1 where v='a'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref v v 258 const # Using where +1 SIMPLE t1 ref v v 303 const # Using where select v,count(*) from t1 group by v limit 10; v count(*) a 1 @@ -1656,15 +1654,15 @@ i 10 select sql_big_result v,count(t) from t1 group by v limit 10; v count(t) a 1 -a 10 -b 10 -c 10 -d 10 -e 10 -f 10 -g 10 -h 10 -i 10 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 alter table t1 drop key v, add key v (v(30)); show create table t1; Table Create Table @@ -1746,8 +1744,6 @@ g 10 h 10 i 10 alter table t1 modify v varchar(600), drop key v, add key v (v); -Warnings: -Warning 1071 Specified key was too long; max key length is 255 bytes show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1756,7 +1752,7 @@ t1 CREATE TABLE `t1` ( `t` text, KEY `c` (`c`), KEY `t` (`t`(10)), - KEY `v` (`v`(255)) + KEY `v` (`v`) ) ENGINE=BerkeleyDB DEFAULT CHARSET=latin1 select v,count(*) from t1 group by v limit 10; v count(*) @@ -1785,15 +1781,15 @@ i 10 select sql_big_result v,count(t) from t1 group by v limit 10; v count(t) a 1 -a 10 -b 10 -c 10 -d 10 -e 10 -f 10 -g 10 -h 10 -i 10 +a 10 +b 10 +c 10 +d 10 +e 10 +f 10 +g 10 +h 10 +i 10 drop table t1; create table t1 (a char(10), unique (a)); insert into t1 values ('a '); @@ -1874,7 +1870,7 @@ a b drop table t1; create table t1 (v varchar(65530), key(v)); Warnings: -Warning 1071 Specified key was too long; max key length is 255 bytes +Warning 1071 Specified key was too long; max key length is MAX_KEY_LENGTH bytes drop table if exists t1; create table t1 (v varchar(65536)); Warnings: diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index ca9a2662f94..84779858b75 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, t2; select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296; 0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296 0 256 65536 2147483647 -2147483648 2147483648 4294967296 diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result index d5b1cf4dd63..4f49f77d46c 100644 --- a/mysql-test/r/connect.result +++ b/mysql-test/r/connect.result @@ -20,9 +20,9 @@ time_zone_transition_type user show tables; Tables_in_test -connect(localhost,root,z,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,root,z,test2,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) -connect(localhost,root,z,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,root,z,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES) grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling"; @@ -47,13 +47,13 @@ time_zone_transition_type user show tables; Tables_in_test -connect(localhost,test,,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) -connect(localhost,test,,"",MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,,"",MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) -connect(localhost,test,zorro,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) -connect(localhost,test,zorro,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) update mysql.user set password=old_password("gambling2") where user=_binary"test"; flush privileges; @@ -82,13 +82,13 @@ time_zone_transition_type user show tables; Tables_in_test -connect(localhost,test,,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) -connect(localhost,test,,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO) -connect(localhost,test,zorro,test2,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) -connect(localhost,test,zorro,test,MASTER_PORT,MYSQL_TEST_DIR/var/tmp/master.sock); +connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET); ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES) delete from mysql.user where user=_binary"test"; flush privileges; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 1f8c6cb464d..a201af78518 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2,t3; +drop table if exists t1,t2,t3,t4,t5; drop database if exists mysqltest; create table t1 (b char(0)); insert into t1 values (""),(null); @@ -654,3 +654,92 @@ t1 CREATE TABLE `t1` ( PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +CREATE TABLE t2 ( +a int(11) default NULL +); +insert into t2 values(111); +create table t1 ( +a varchar(12) charset utf8 collate utf8_bin not null, +b int not null, primary key (a) +) select a, 1 as b from t2 ; +Warnings: +Warning 1364 Field 'a' doesn't have a default value +Warning 1364 Field 'b' doesn't have a default value +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(12) character set utf8 collate utf8_bin NOT NULL, + `b` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 ( +a varchar(12) charset utf8 collate utf8_bin not null, +b int not null, primary key (a) +) select 'a' as a , 1 as b from t2 ; +Warnings: +Warning 1364 Field 'a' doesn't have a default value +Warning 1364 Field 'b' doesn't have a default value +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(12) character set utf8 collate utf8_bin NOT NULL, + `b` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 ( +a varchar(12) charset utf8 collate utf8_bin, +b int not null, primary key (a) +) select 'a' as a , 1 as b from t2 ; +Warnings: +Warning 1364 Field 'b' doesn't have a default value +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(12) character set utf8 collate utf8_bin NOT NULL default '', + `b` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; +create table t1 ( +a1 int not null, +a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int +); +insert into t1 values (1,1,1, 1,1,1, 1,1,1); +create table t2 ( +a1 varchar(12) charset utf8 collate utf8_bin not null, +a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, +primary key (a1) +) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ; +Warnings: +Warning 1364 Field 'a1' doesn't have a default value +drop table t2; +create table t2 ( +a1 varchar(12) charset utf8 collate utf8_bin, +a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int +) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1; +drop table t1, t2; +create table t1 ( +a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int +); +insert into t1 values (1,1,1, 1,1,1, 1,1,1); +create table t2 ( +a1 varchar(12) charset utf8 collate utf8_bin not null, +a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, +primary key (a1) +) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ; +Warnings: +Warning 1364 Field 'a1' doesn't have a default value +drop table t2; +create table t2 ( a int default 3, b int default 3) +select a1,a2 from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) default '3', + `b` int(11) default '3', + `a1` int(11) default NULL, + `a2` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1, t2; diff --git a/mysql-test/r/csv.result b/mysql-test/r/csv.result index ea0d34271b5..2e3d11ad461 100644 --- a/mysql-test/r/csv.result +++ b/mysql-test/r/csv.result @@ -4929,3 +4929,50 @@ Warnings: Note 1051 Unknown table 't2' Note 1051 Unknown table 't3' Note 1051 Unknown table 't4' +DROP TABLE IF EXISTS bug13894; +CREATE TABLE bug13894 ( val integer ) ENGINE = CSV; +INSERT INTO bug13894 VALUES (5); +INSERT INTO bug13894 VALUES (10); +INSERT INTO bug13894 VALUES (11); +INSERT INTO bug13894 VALUES (10); +SELECT * FROM bug13894; +val +5 +10 +11 +10 +UPDATE bug13894 SET val=6 WHERE val=10; +SELECT * FROM bug13894; +val +5 +11 +6 +6 +DROP TABLE bug13894; +DROP TABLE IF EXISTS bug14672; +CREATE TABLE bug14672 (c1 integer) engine = CSV; +INSERT INTO bug14672 VALUES (1), (2), (3); +SELECT * FROM bug14672; +c1 +1 +2 +3 +DELETE FROM bug14672 WHERE c1 = 2; +SELECT * FROM bug14672; +c1 +1 +3 +INSERT INTO bug14672 VALUES (4); +SELECT * FROM bug14672; +c1 +1 +3 +4 +INSERT INTO bug14672 VALUES (5); +SELECT * FROM bug14672; +c1 +1 +3 +4 +5 +DROP TABLE bug14672; diff --git a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog.result new file mode 100644 index 00000000000..d04fce7738c --- /dev/null +++ b/mysql-test/r/ctype_cp932_binlog.result @@ -0,0 +1,17 @@ +drop table if exists t1; +set names cp932; +set character_set_database = cp932; +RESET MASTER; +CREATE TABLE t1(f1 blob); +PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)'; +SET @var1= x'8300'; +EXECUTE stmt1 USING @var1; +SHOW BINLOG EVENTS FROM 98; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 98 Query 1 185 use `test`; CREATE TABLE t1(f1 blob) +master-bin.000001 185 User var 1 224 @`var1`=_binary 0x8300 COLLATE binary +master-bin.000001 224 Query 1 317 use `test`; INSERT INTO t1 VALUES(@'var1') +SELECT HEX(f1) FROM t1; +HEX(f1) +8300 +DROP table t1; diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 7e18cb9f75f..7f53bd884ef 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -1490,6 +1490,33 @@ id name DROP TABLE federated.alter_me; DROP TABLE federated.normal_table; DROP TABLE IF EXISTS federated.t1; +CREATE TABLE federated.t1 ( +`bitty` bit(3) +) DEFAULT CHARSET=latin1; +DROP TABLE IF EXISTS federated.t1; +CREATE TABLE federated.t1 ( +`bitty` bit(3) +) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +INSERT INTO federated.t1 VALUES (b'001'); +INSERT INTO federated.t1 VALUES (b'010'); +INSERT INTO federated.t1 VALUES (b'011'); +INSERT INTO federated.t1 VALUES (b'100'); +INSERT INTO federated.t1 VALUES (b'101'); +INSERT INTO federated.t1 VALUES (b'110'); +INSERT INTO federated.t1 VALUES (b'111'); +select * FROM federated.t1; +bitty + + + + + + + +drop table federated.t1; +drop table federated.t1; +DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index 6461c393d51..90884dcc596 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -93,7 +93,7 @@ explain extended select grp,group_concat(distinct c order by c desc) from t1 gro id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` separator ',') AS `group_concat(distinct c order by c desc)` from `test`.`t1` group by `test`.`t1`.`grp` +Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` DESC separator ',') AS `group_concat(distinct c order by c desc)` from `test`.`t1` group by `test`.`t1`.`grp` select grp,group_concat(c order by c separator ",") from t1 group by grp; grp group_concat(c order by c separator ",") 1 a @@ -113,7 +113,7 @@ explain extended select grp,group_concat(distinct c order by c separator ",") fr id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort Warnings: -Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` separator ',') AS `group_concat(distinct c order by c separator ",")` from `test`.`t1` group by `test`.`t1`.`grp` +Note 1003 select `test`.`t1`.`grp` AS `grp`,group_concat(distinct `test`.`t1`.`c` order by `test`.`t1`.`c` ASC separator ',') AS `group_concat(distinct c order by c separator ",")` from `test`.`t1` group by `test`.`t1`.`grp` select grp,group_concat(distinct c order by c desc separator ",") from t1 group by grp; grp group_concat(distinct c order by c desc separator ",") 1 a diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index f209866d953..d984eee80fa 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -180,8 +180,8 @@ Field Type Null Key Default Extra f1 date NO 0000-00-00 f2 datetime YES NULL f3 time YES NULL -f4 time NO 00:00:00 -f5 time NO 00:00:00 +f4 time YES NULL +f5 time YES NULL f6 time NO 00:00:00 f7 datetime YES NULL f8 date YES NULL diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 90857ecfc6d..049ba784dc9 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -665,6 +665,12 @@ ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field insert into t1 values (pointfromtext('point(1,1)')); ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1; +select (asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))); +(asWKT(geomfromwkb((0x000000000140240000000000004024000000000000)))) +POINT(10 10) +select (asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))); +(asWKT(geomfromwkb((0x010100000000000000000024400000000000002440)))) +POINT(10 10) create table t1 (s1 geometry not null,s2 char(100)); create trigger t1_bu before update on t1 for each row set new.s1 = null; insert into t1 values (null,null); diff --git a/mysql-test/r/join_nested.result b/mysql-test/r/join_nested.result index 9d514be76e8..c4dd6cf9a86 100644 --- a/mysql-test/r/join_nested.result +++ b/mysql-test/r/join_nested.result @@ -1403,3 +1403,67 @@ SELECT v2.x FROM v2 JOIN t2 ON e=b JOIN t3 ON e=c JOIN t4 USING(d); ERROR 42S22: Unknown column 'v2.x' in 'field list' DROP VIEW v1, v2; DROP TABLE t1, t2, t3, t4, t5, t6; +create table t1 (id1 int(11) not null); +insert into t1 values (1),(2); +create table t2 (id2 int(11) not null); +insert into t2 values (1),(2),(3),(4); +create table t3 (id3 char(16) not null); +insert into t3 values ('100'); +create table t4 (id2 int(11) not null, id3 char(16)); +create table t5 (id1 int(11) not null, key (id1)); +insert into t5 values (1),(2),(1); +create view v1 as +select t4.id3 from t4 join t2 on t4.id2 = t2.id2; +select t1.id1 from t1 inner join (t3 left join v1 on t3.id3 = v1.id3); +id1 +1 +2 +drop view v1; +drop table t1, t2, t3, t4, t5; +create table t0 (a int); +insert into t0 values (0),(1),(2),(3); +create table t1(a int); +insert into t1 select A.a + 10*(B.a) from t0 A, t0 B; +create table t2 (a int, b int); +insert into t2 values (1,1), (2,2), (3,3); +create table t3(a int, b int, filler char(200), key(a)); +insert into t3 select a,a,'filler' from t1; +insert into t3 select a,a,'filler' from t1; +create table t4 like t3; +insert into t4 select * from t3; +insert into t4 select * from t3; +create table t5 like t4; +insert into t5 select * from t4; +insert into t5 select * from t4; +create table t6 like t5; +insert into t6 select * from t5; +insert into t6 select * from t5; +create table t7 like t6; +insert into t7 select * from t6; +insert into t7 select * from t6; +explain select * from t4 join +t2 left join (t3 join t5 on t5.a=t3.b) on t3.a=t2.b where t4.a<=>t3.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL X +1 SIMPLE t3 ref a a 5 test.t2.b X +1 SIMPLE t5 ref a a 5 test.t3.b X +1 SIMPLE t4 ref a a 5 test.t3.b X Using where +explain select * from (t4 join t6 on t6.a=t4.b) right join t3 on t4.a=t3.b +join t2 left join (t5 join t7 on t7.a=t5.b) on t5.a=t2.b where t3.a<=>t2.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL X +1 SIMPLE t3 ref a a 5 test.t2.b X Using where +1 SIMPLE t4 ref a a 5 test.t3.b X +1 SIMPLE t6 ref a a 5 test.t4.b X +1 SIMPLE t5 ref a a 5 test.t2.b X +1 SIMPLE t7 ref a a 5 test.t5.b X +explain select * from t2 left join +(t3 left join (t4 join t6 on t6.a=t4.b) on t4.a=t3.b +join t5 on t5.a=t3.b) on t3.a=t2.b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL NULL NULL NULL NULL X +1 SIMPLE t3 ref a a 5 test.t2.b X +1 SIMPLE t4 ref a a 5 test.t3.b X +1 SIMPLE t6 ref a a 5 test.t4.b X +1 SIMPLE t5 ref a a 5 test.t3.b X +drop table t0, t1, t2, t4, t5, t6; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index b4265a99604..7da55b66376 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -701,6 +701,24 @@ t1 1 a 2 b A 0 NULL NULL YES BTREE t1 1 a 3 c A 0 NULL NULL YES BTREE t1 1 a 4 d A 0 NULL NULL YES BTREE set myisam_stats_method=DEFAULT; +drop table t1; +create table t1( +cip INT NOT NULL, +time TIME NOT NULL, +score INT NOT NULL DEFAULT 0, +bob TINYBLOB +); +insert into t1 (cip, time) VALUES (1, '00:01'), (2, '00:02'), (3,'00:03'); +insert into t1 (cip, bob, time) VALUES (4, 'a', '00:04'), (5, 'b', '00:05'), +(6, 'c', '00:06'); +select * from t1 where bob is null and cip=1; +cip time score bob +1 00:01:00 0 NULL +create index bug on t1 (bob(22), cip, time); +select * from t1 where bob is null and cip=1; +cip time score bob +1 00:01:00 0 NULL +drop table t1; set storage_engine=MyISAM; drop table if exists t1,t2,t3; --- Testing varchar --- diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 756a830ebc0..82a761252b5 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -1677,6 +1677,16 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir </database> </mysqldump> drop table t1, t2; +create table t1 (a text character set utf8, b text character set latin1); +insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E); +select * from t1; +a b +Osnabrück Köln +test.t1: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0 +select * from t1; +a b +Osnabrück Köln +drop table t1; create table t1(a int); create view v1 as select * from t1; @@ -2226,6 +2236,7 @@ DROP FUNCTION bug9056_func1; DROP FUNCTION bug9056_func2; DROP PROCEDURE bug9056_proc1; DROP PROCEDURE bug9056_proc2; +DROP PROCEDURE `a'b`; drop table t1; drop table if exists t1; create table t1 (`d` timestamp, unique (`d`)); diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index a374f845933..e288592c390 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -673,3 +673,7 @@ select * from atablewithareallylongandirritatingname; a 2 drop table atablewithareallylongandirritatingname; +CREATE TABLE t1 ( b INT ) PACK_KEYS = 0 ENGINE = ndb; +select * from t1; +b +drop table t1; diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result new file mode 100644 index 00000000000..55a14bcaec8 --- /dev/null +++ b/mysql-test/r/read_only.result @@ -0,0 +1,43 @@ +DROP TABLE IF EXISTS t1,t2,t3; +grant CREATE, SELECT, DROP on *.* to test@localhost; +set global read_only=0; +create table t1 (a int); +insert into t1 values(1); +create table t2 select * from t1; +set global read_only=1; +create table t3 (a int); +drop table t3; +select @@global.read_only; +@@global.read_only +1 +create table t3 (a int); +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +insert into t1 values(1); +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +update t1 set a=1 where 1=0; +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +update t1,t2 set t1.a=t2.a+1 where t1.a=t2.a; +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +delete t1,t2 from t1,t2 where t1.a=t2.a; +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +create temporary table t3 (a int); +create temporary table t4 (a int) select * from t3; +insert into t3 values(1); +insert into t4 select * from t3; +update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a; +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +update t1,t3 set t3.a=t1.a+1 where t1.a=t3.a; +update t4,t3 set t4.a=t3.a+1 where t4.a=t3.a; +delete t1 from t1,t3 where t1.a=t3.a; +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +delete t3 from t1,t3 where t1.a=t3.a; +delete t4 from t3,t4 where t4.a=t3.a; +create temporary table t1 (a int); +insert into t1 values(1); +update t1,t3 set t1.a=t3.a+1 where t1.a=t3.a; +delete t1 from t1,t3 where t1.a=t3.a; +drop table t1; +insert into t1 values(1); +ERROR HY000: The MySQL server is running with the --read-only option so it cannot execute this statement +drop table t1,t2; +drop user test@localhost; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 76a8b5a11e7..318cf8e7b65 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3201,3 +3201,43 @@ a b c select * from t1 join t2 straight_join t3 on (t1.a=t3.c); a b c drop table t1, t2 ,t3; +create table t1(f1 int, f2 date); +insert into t1 values(1,'2005-01-01'),(2,'2005-09-01'),(3,'2005-09-30'), +(4,'2005-10-01'),(5,'2005-12-30'); +select * from t1 where f2 >= 0; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '0000-00-00'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '2005-09-31'; +f1 f2 +4 2005-10-01 +5 2005-12-30 +select * from t1 where f2 >= '2005-09-3a'; +f1 f2 +4 2005-10-01 +5 2005-12-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +select * from t1 where f2 <= '2005-09-31'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +select * from t1 where f2 <= '2005-09-3a'; +f1 f2 +1 2005-01-01 +2 2005-09-01 +3 2005-09-30 +Warnings: +Warning 1292 Incorrect date value: '2005-09-3a' for column 'f2' at row 1 +drop table t1; diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 1f3f7dba7da..d50e6dd3751 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -3575,4 +3575,46 @@ DROP VIEW bug13095_v1 DROP PROCEDURE IF EXISTS bug13095; DROP VIEW IF EXISTS bug13095_v1; DROP TABLE IF EXISTS bug13095_t1; +drop procedure if exists bug14210| +set @@session.max_heap_table_size=16384| +select @@session.max_heap_table_size| +@@session.max_heap_table_size +16384 +create table t3 (a char(255)) engine=InnoDB| +create procedure bug14210_fill_table() +begin +declare table_size, max_table_size int default 0; +select @@session.max_heap_table_size into max_table_size; +delete from t3; +insert into t3 (a) values (repeat('a', 255)); +repeat +insert into t3 select a from t3; +select count(*)*255 from t3 into table_size; +until table_size > max_table_size*2 end repeat; +end| +call bug14210_fill_table()| +drop procedure bug14210_fill_table| +create table t4 like t3| +create procedure bug14210() +begin +declare a char(255); +declare done int default 0; +declare c cursor for select * from t3; +declare continue handler for sqlstate '02000' set done = 1; +open c; +repeat +fetch c into a; +if not done then +insert into t4 values (upper(a)); +end if; +until done end repeat; +close c; +end| +call bug14210()| +select count(*) from t4| +count(*) +256 +drop table t3, t4| +drop procedure bug14210| +set @@session.max_heap_table_size=default| drop table t1,t2; diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index 03aa04f491b..7d7fe7efa35 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -176,7 +176,7 @@ Table Create Table t1 CREATE TABLE `t1` ( `round(15.4,-1)` decimal(3,0) unsigned NOT NULL default '0', `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0', - `abs(-1.1)` decimal(2,1) default NULL, + `abs(-1.1)` decimal(2,1) NOT NULL default '0.0', `-(-1.1)` decimal(2,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -846,15 +846,14 @@ select 0/0; NULL select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x; x -999999999999999999999999999999999999999999999999999999999999999999999999999999999 +99999999999999999999999999999999999999999999999999999999999999999 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x; x -NULL +100000000000000000000000000000000000000000000000000000000000000000 Warnings: Error 1292 Truncated incorrect DECIMAL value: '' -Error 1292 Truncated incorrect DECIMAL value: '' select 0.190287977636363637 + 0.040372670 * 0 - 0; 0.190287977636363637 + 0.040372670 * 0 - 0 0.190287977636363637 @@ -1431,3 +1430,26 @@ my_decimal my_varchar 0.011754943450000000000000000000 1.175494345e-2 0.117549434500000000000000000000 1.175494345e-1 DROP TABLE t1; +create table t1 (c1 decimal(64)); +insert into t1 values( +89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values( +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 * +99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999); +Warnings: +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Error 1292 Truncated incorrect DECIMAL value: '' +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +insert into t1 values(1e100); +Warnings: +Warning 1264 Out of range value adjusted for column 'c1' at row 1 +select * from t1; +c1 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +9999999999999999999999999999999999999999999999999999999999999999 +drop table t1; diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 71de6830963..aeb44fa4e6c 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -337,3 +337,11 @@ a b 22 3 23 3 drop table t1; +create table t1 (f1 date not null); +insert into t1 values('2000-01-01'),('0000-00-00'); +update t1 set f1='2002-02-02' where f1 is null; +select * from t1; +f1 +2000-01-01 +2002-02-02 +drop table t1; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index acdc793fb69..75a680e504d 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -123,6 +123,17 @@ select @a+0, @a:=@a+0+count(*), count(*), @a+0 from t1 group by i; 0 1 1 0 1 3 2 0 3 6 3 0 +set @a=0; +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; +@a @a:="hello" @a @a:=3 @a @a:="hello again" +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again +0 hello 0 3 0 hello again +select @a,@a:="hello",@a,@a:=3,@a,@a:="hello again" from t1 group by i; +@a @a:="hello" @a @a:=3 @a @a:="hello again" +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again +hello again hello hello again 3 hello again hello again drop table t1; set @a=_latin2'test'; select charset(@a),collation(@a),coercibility(@a); diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 6f15e7af399..b31ec9a3bab 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2,t9,`t1a``b`,v1,v2,v3,v4,v5,v6; +drop table if exists t1,t2,t3,t4,t9,`t1a``b`,v1,v2,v3,v4,v5,v6; drop view if exists t1,t2,`t1a``b`,v1,v2,v3,v4,v5,v6; drop database if exists mysqltest; use test; @@ -2323,3 +2323,55 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where DROP VIEW v1,v2; DROP TABLE t1,t2,t3; +create table t1 (f1 int, f2 int); +insert into t1 values(1,1),(1,2),(1,3); +create view v1 as select f1 ,group_concat(f2 order by f2 asc) from t1 group by f1; +create view v2 as select f1 ,group_concat(f2 order by f2 desc) from t1 group by f1; +select * from v1; +f1 group_concat(f2 order by f2 asc) +1 1,2,3 +select * from v2; +f1 group_concat(f2 order by f2 desc) +1 3,2,1 +drop view v1,v2; +drop table t1; +create table t1 (x int, y int); +create table t2 (x int, y int, z int); +create table t3 (x int, y int, z int); +create table t4 (x int, y int, z int); +create view v1 as +select t1.x +from ( +(t1 join t2 on ((t1.y = t2.y))) +join +(t3 left join t4 on (t3.y = t4.y) and (t3.z = t4.z)) +); +prepare stmt1 from "select count(*) from v1 where x = ?"; +set @parm1=1; +execute stmt1 using @parm1; +count(*) +0 +execute stmt1 using @parm1; +count(*) +0 +drop view v1; +drop table t1,t2,t3,t4; +CREATE TABLE t1(id INT); +CREATE VIEW v1 AS SELECT id FROM t1; +OPTIMIZE TABLE v1; +Table Op Msg_type Msg_text +test.v1 optimize note Unknown table 'test.v1' +ANALYZE TABLE v1; +Table Op Msg_type Msg_text +test.v1 analyze note Unknown table 'test.v1' +REPAIR TABLE v1; +Table Op Msg_type Msg_text +test.v1 repair note Unknown table 'test.v1' +DROP TABLE t1; +OPTIMIZE TABLE v1; +Table Op Msg_type Msg_text +test.v1 optimize note Unknown table 'test.v1' +Warnings: +Error 1146 Table 'test.t1' doesn't exist +Error 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them +DROP VIEW v1; |