diff options
author | unknown <kostja@bodhi.local> | 2006-08-12 21:06:51 +0400 |
---|---|---|
committer | unknown <kostja@bodhi.local> | 2006-08-12 21:06:51 +0400 |
commit | f68085c4e75a2ef4db33a9500b07ad4e37bf8b95 (patch) | |
tree | cccb1fdd583e353f4a229cbb0f9d585104db78f9 /mysql-test/r | |
parent | eef51cd83d952b786def92fccde44b41a007c989 (diff) | |
parent | 4abe4b1717b099dbf3502e041c246b196622a23f (diff) | |
download | mariadb-git-f68085c4e75a2ef4db33a9500b07ad4e37bf8b95.tar.gz |
Merge bodhi.local:/opt/local/work/tmp_merge
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
BitKeeper/etc/ignore:
auto-union
BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921:
Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
Auto merged
BitKeeper/deleted/.del-mysys.dsp~32695fee91189326:
Auto merged
BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833:
Auto merged
BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048:
Auto merged
BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f:
Auto merged
client/mysql.cc:
Auto merged
client/mysqlbinlog.cc:
Auto merged
client/mysqlcheck.c:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
dbug/dbug.c:
Auto merged
extra/perror.c:
Auto merged
extra/yassl/src/yassl_imp.cpp:
Auto merged
extra/yassl/src/yassl_int.cpp:
Auto merged
include/mysql.h:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/r/cast.result:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/federated.result:
Auto merged
mysql-test/r/func_compress.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/gis-rtree.result:
Auto merged
mysql-test/r/gis.result:
Auto merged
mysql-test/r/im_daemon_life_cycle.result:
Auto merged
mysql-test/r/im_utils.result:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/r/mysqlcheck.result:
Auto merged
mysql-test/r/rpl_sp.result:
Auto merged
mysql-test/r/rpl_trigger.result:
Auto merged
mysql-test/r/sp-code.result:
Auto merged
mysql-test/r/sp-security.result:
Auto merged
mysql-test/r/strict.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/r/type_datetime.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/r/udf.result:
Auto merged
mysql-test/r/user_var.result:
Auto merged
mysql-test/t/cast.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/func_group.test:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
mysql-test/t/im_life_cycle.imtest:
Auto merged
mysql-test/t/im_utils.imtest:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/mysqlbinlog.test:
Auto merged
mysql-test/t/mysqlcheck.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/rpl_trigger.test:
Auto merged
mysql-test/t/sp-security.test:
Auto merged
mysql-test/t/strict.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
sql/field.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_udf.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.cc:
Auto merged
sql-common/client.c:
Auto merged
sql-common/my_time.c:
Auto merged
sql/table.h:
Auto merged
storage/ndb/src/kernel/error/ndbd_exit_codes.c:
Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
mysql-test/r/im_life_cycle.result:
e
use local
mysql-test/r/ps.result:
use local
client/Makefile.am:
Manual merge.
client/mysqlimport.c:
Manual merge.
configure.in:
Manual merge.
mysql-test/mysql-test-run.pl:
Manual merge.
mysql-test/r/mysqldump.result:
Manual merge.
mysql-test/r/mysqltest.result:
Manual merge.
mysql-test/r/ndb_basic.result:
Manual merge.
mysql-test/r/rpl_view.result:
Manual merge.
mysql-test/r/show_check.result:
Manual merge.
mysql-test/r/sp-error.result:
Manual merge.
mysql-test/r/sp.result:
Manual merge.
mysql-test/r/union.result:
Manual merge.
mysql-test/t/mysqldump.test:
Manual merge.
mysql-test/t/mysqltest.test:
Manual merge.
mysql-test/t/ndb_basic.test:
Manual merge.
mysql-test/t/rpl_sp.test:
Manual merge.
mysql-test/t/rpl_view.test:
Manual merge.
mysql-test/t/show_check.test:
Manual merge.
mysql-test/t/sp-error.test:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
sql/item_sum.cc:
Manual merge.
sql/mysql_priv.h:
Manual merge.
sql/sp_head.cc:
Manual merge.
sql/sql_db.cc:
Manual merge.
sql/sql_delete.cc:
Manual merge.
sql/sql_lex.h:
Manual merge.
sql/sql_show.cc:
Manual merge.
sql/sql_table.cc:
Manual merge.
sql/sql_trigger.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge.
tests/mysql_client_test.c:
Manual merge.
Diffstat (limited to 'mysql-test/r')
38 files changed, 765 insertions, 12 deletions
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index 5e8f5dca711..27a36b0cb7c 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -381,3 +381,14 @@ DROP TABLE t1; select cast(NULL as decimal(6)) as t1; t1 NULL +set names latin1; +select hex(cast('a' as char(2) binary)); +hex(cast('a' as char(2) binary)) +61 +select hex(cast('a' as binary(2))); +hex(cast('a' as binary(2))) +6100 +select hex(cast('a' as char(2) binary)); +hex(cast('a' as char(2) binary)) +61 +End of 5.0 tests diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index ee70327d17b..017631bf8d1 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -452,6 +452,8 @@ create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:% str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2, str_to_date("2003-01-02", "%Y-%m-%d") as f3, str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5; +Warnings: +Warning 1265 Data truncated for column 'f4' at row 1 describe t1; Field Type Null Key Default Extra f1 datetime YES NULL @@ -461,7 +463,7 @@ f4 date YES NULL f5 time YES NULL select * from t1; f1 f2 f3 f4 f5 -2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-02 58:00:00 +2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-00 58:00:00 drop table t1; create table t1 select "02 10" as a, "%d %H" as b; select str_to_date(a,b) from t1; diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 05f1c967e77..0946dc8f809 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -192,3 +192,13 @@ delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b; select * from t3; a b drop table t1,t2,t3; +create table t1(a date not null); +insert into t1 values (0); +select * from t1 where a is null; +a +0000-00-00 +delete from t1 where a is null; +select count(*) from t1; +count(*) +0 +drop table t1; diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 97d138cfc76..77e2d251cb8 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -967,6 +967,8 @@ CREATE TABLE federated.t1 ( `blurb` text default '', PRIMARY KEY (blurb_id)) DEFAULT CHARSET=latin1; +Warnings: +Warning 1101 BLOB/TEXT column 'blurb' can't have a default value DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( `blurb_id` int NOT NULL DEFAULT 0, @@ -975,6 +977,8 @@ PRIMARY KEY (blurb_id)) ENGINE="FEDERATED" DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'; +Warnings: +Warning 1101 BLOB/TEXT column 'blurb' can't have a default value INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values."); INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE."); INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. "); diff --git a/mysql-test/r/fulltext_distinct.result b/mysql-test/r/fulltext_distinct.result index de0668ff28c..7fd42fab646 100644 --- a/mysql-test/r/fulltext_distinct.result +++ b/mysql-test/r/fulltext_distinct.result @@ -8,6 +8,8 @@ KEY kt(tag), KEY kv(value(15)), FULLTEXT KEY kvf(value) ) ENGINE=MyISAM; +Warnings: +Warning 1101 BLOB/TEXT column 'value' can't have a default value CREATE TABLE t2 ( id_t2 mediumint unsigned NOT NULL default '0', id_t1 mediumint unsigned NOT NULL default '0', diff --git a/mysql-test/r/fulltext_update.result b/mysql-test/r/fulltext_update.result index 5d3f95b318c..4a615c88fdd 100644 --- a/mysql-test/r/fulltext_update.result +++ b/mysql-test/r/fulltext_update.result @@ -9,6 +9,8 @@ name VARCHAR(80) DEFAULT '' NOT NULL, FULLTEXT(url,description,shortdesc,longdesc), PRIMARY KEY(gnr) ); +Warnings: +Warning 1101 BLOB/TEXT column 'longdesc' can't have a default value insert into test (url,shortdesc,longdesc,description,name) VALUES ("http:/test.at", "kurz", "lang","desc", "name"); insert into test (url,shortdesc,longdesc,description,name) VALUES diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index a4b780d146a..1a5e64978e6 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -79,3 +79,31 @@ uncompress(a) uncompressed_length(a) NULL NULL a 1 drop table t1; +create table t1 (a varchar(32) not null); +insert into t1 values ('foo'); +explain select * from t1 where uncompress(a) is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Error 1259 ZLIB: Input data corrupted +select * from t1 where uncompress(a) is null; +a +foo +Warnings: +Error 1259 ZLIB: Input data corrupted +explain select *, uncompress(a) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +select *, uncompress(a) from t1; +a uncompress(a) +foo NULL +Warnings: +Error 1259 ZLIB: Input data corrupted +select *, uncompress(a), uncompress(a) is null from t1; +a uncompress(a) uncompress(a) is null +foo NULL 1 +Warnings: +Error 1259 ZLIB: Input data corrupted +Error 1259 ZLIB: Input data corrupted +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 74da6478470..26cf94bb820 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -990,3 +990,17 @@ FROM t1 t, t2 c WHERE t.a = c.b; minid NULL DROP TABLE t1,t2; +create table t1 select variance(0); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `variance(0)` double(8,4) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 select stddev(0); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `stddev(0)` double(8,4) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 487d40f8a67..7f7228fbf4d 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -667,6 +667,78 @@ timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3, timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4; a1 a2 a3 a4 28 28 29 29 +SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27'); +TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27') +0 +SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28'); +TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28') +1 +SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29'); +TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29') +1 +SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27'); +TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27') +1 +SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28'); +TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28') +2 +SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29'); +TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29') +2 +SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27'); +TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27') +0 +SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28'); +TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28') +1 +SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29'); +TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29') +1 +SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27'); +TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27') +1 +SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28'); +TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28') +2 +SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29'); +TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29') +2 +SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27'); +TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27') +0 +SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28'); +TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28') +1 +SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29'); +TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29') +1 +SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27'); +TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27') +1 +SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28'); +TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28') +2 +SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29'); +TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29') +2 +SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27'); +TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27') +0 +SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28'); +TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28') +1 +SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29'); +TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29') +1 +SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27'); +TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27') +1 +SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28'); +TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28') +2 +SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29'); +TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29') +2 select date_add(time,INTERVAL 1 SECOND) from t1; date_add(time,INTERVAL 1 SECOND) NULL diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index e2e7a612dec..92fcbfcdc9e 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -804,6 +804,8 @@ INSERT INTO t2 SELECT GeomFromText(st) FROM t1; ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field drop table t1, t2; CREATE TABLE t1 (`geometry` geometry NOT NULL default '',SPATIAL KEY `gndx` (`geometry`(32))) ENGINE=MyISAM DEFAULT CHARSET=latin1; +Warnings: +Warning 1101 BLOB/TEXT column 'geometry' can't have a default value INSERT INTO t1 (geometry) VALUES (PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, -18.7186111000 -66.8102777000, -18.7211111000 -66.9269443999, @@ -820,6 +822,8 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1(32)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +Warnings: +Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, @@ -834,6 +838,8 @@ CREATE TABLE t1 ( c1 geometry NOT NULL default '', SPATIAL KEY i1 (c1(32)) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +Warnings: +Warning 1101 BLOB/TEXT column 'c1' can't have a default value INSERT INTO t1 (c1) VALUES ( PolygonFromText('POLYGON((-18.6086111000 -66.9327777000, -18.6055555000 -66.8158332999, diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 9017e96c8f4..8fff04508d1 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -583,6 +583,8 @@ t1 CREATE TABLE `t1` ( drop table t1; CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` geometry NOT NULL default '') ENGINE=MyISAM ; +Warnings: +Warning 1101 BLOB/TEXT column 'geo' can't have a default value insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163 36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363 diff --git a/mysql-test/r/have_perror.require b/mysql-test/r/have_perror.require new file mode 100644 index 00000000000..260687c87f0 --- /dev/null +++ b/mysql-test/r/have_perror.require @@ -0,0 +1,2 @@ +have_perror +1 diff --git a/mysql-test/r/im_daemon_life_cycle.result b/mysql-test/r/im_daemon_life_cycle.result index a5526a31384..927ea86dfdd 100644 --- a/mysql-test/r/im_daemon_life_cycle.result +++ b/mysql-test/r/im_daemon_life_cycle.result @@ -1,4 +1,7 @@ Success: the process has been started. +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 SHOW INSTANCES; instance_name state mysqld1 online diff --git a/mysql-test/r/im_utils.result b/mysql-test/r/im_utils.result index df20a7fb5c7..ee70d7950f8 100644 --- a/mysql-test/r/im_utils.result +++ b/mysql-test/r/im_utils.result @@ -1,4 +1,7 @@ Success: the process has been started. +SHOW VARIABLES LIKE 'server_id'; +Variable_name Value +server_id 1 SHOW INSTANCES; instance_name state mysqld1 online diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index b199ec5b2fb..aca47a675d4 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -598,6 +598,8 @@ id int(11) DEFAULT '0' NOT NULL, name tinytext DEFAULT '' NOT NULL, UNIQUE id (id) ); +Warnings: +Warning 1101 BLOB/TEXT column 'name' can't have a default value INSERT INTO t1 VALUES (1,'yes'),(2,'no'); CREATE TABLE t2 ( id int(11) DEFAULT '0' NOT NULL, diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result index d70366a7589..c133e4eb2cb 100644 --- a/mysql-test/r/mysql.result +++ b/mysql-test/r/mysql.result @@ -104,4 +104,14 @@ c_cp932 | 2 | NULL | | 3 | | +------+------+ +create table t1(a int, b varchar(255), c int); +Field Type Null Key Default Extra +a int(11) YES NULL +b varchar(255) YES NULL +c int(11) YES NULL +Field Type Null Key Default Extra +a int(11) YES NULL +b varchar(255) YES NULL +c int(11) YES NULL +drop table t1; End of 5.0 tests diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result index a3c14b13bde..a76402a87b0 100644 --- a/mysql-test/r/mysqlcheck.result +++ b/mysql-test/r/mysqlcheck.result @@ -48,3 +48,10 @@ mysql.time_zone_name OK mysql.time_zone_transition OK mysql.time_zone_transition_type OK mysql.user OK +create table t1 (a int); +create view v1 as select * from t1; +test.t1 OK +test.t1 OK +drop view v1; +drop table t1; +End of 5.0 tests diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 153ddb7ca2b..9d44756f17c 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2324,7 +2324,7 @@ RETURN a+b */;; /*!50003 SET SESSION SQL_MODE=@OLD_SQL_MODE*/;; /*!50003 DROP FUNCTION IF EXISTS `bug9056_func2` */;; /*!50003 SET SESSION SQL_MODE=""*/;; -/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) +/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 FUNCTION `bug9056_func2`(f1 char binary) RETURNS char(1) CHARSET latin1 begin set f1= concat( 'hello', f1 ); return f1; @@ -2914,6 +2914,22 @@ drop view v1; drop table t1; drop database mysqldump_dbb; use test; +create user mysqltest_1; +create table t1(a int, b varchar(34)); +reset master; +mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need the RELOAD privilege for this operation (1227) +mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need the RELOAD privilege for this operation (1227) +grant RELOAD on *.* to mysqltest_1@localhost; +mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227) +mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need the SUPER,REPLICATION CLIENT privilege for this operation (1227) +grant REPLICATION CLIENT on *.* to mysqltest_1@localhost; +CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=537; +CREATE TABLE `t1` ( + `a` int(11) default NULL, + `b` varchar(34) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +drop table t1; +drop user mysqltest_1; End of 5.0 tests create table t1 (a text , b text); create table t2 (a text , b text); diff --git a/mysql-test/r/mysqlshow.result b/mysql-test/r/mysqlshow.result index 942cde83f21..2bf8a58de4e 100644 --- a/mysql-test/r/mysqlshow.result +++ b/mysql-test/r/mysqlshow.result @@ -75,3 +75,52 @@ Database: test 2 rows in set. DROP TABLE t1, t2; +Database: information_schema ++---------------------------------------+ +| Tables | ++---------------------------------------+ +| CHARACTER_SETS | +| COLLATIONS | +| COLLATION_CHARACTER_SET_APPLICABILITY | +| COLUMNS | +| COLUMN_PRIVILEGES | +| KEY_COLUMN_USAGE | +| ROUTINES | +| SCHEMATA | +| SCHEMA_PRIVILEGES | +| STATISTICS | +| TABLES | +| TABLE_CONSTRAINTS | +| TABLE_PRIVILEGES | +| TRIGGERS | +| USER_PRIVILEGES | +| VIEWS | ++---------------------------------------+ +Database: INFORMATION_SCHEMA ++---------------------------------------+ +| Tables | ++---------------------------------------+ +| CHARACTER_SETS | +| COLLATIONS | +| COLLATION_CHARACTER_SET_APPLICABILITY | +| COLUMNS | +| COLUMN_PRIVILEGES | +| KEY_COLUMN_USAGE | +| ROUTINES | +| SCHEMATA | +| SCHEMA_PRIVILEGES | +| STATISTICS | +| TABLES | +| TABLE_CONSTRAINTS | +| TABLE_PRIVILEGES | +| TRIGGERS | +| USER_PRIVILEGES | +| VIEWS | ++---------------------------------------+ +Wildcard: inf_rmation_schema ++--------------------+ +| Databases | ++--------------------+ +| information_schema | ++--------------------+ +End of 5.0 tests diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index ef4dd83564b..a50b1dfd5ab 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -440,6 +440,13 @@ select-me ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'insertz error query' at line 1 drop table t1; drop table t1; +sleep; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sleep' at line 1 +sleep; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'sleep' at line 1 +; +ERROR 42000: Query was empty +End of 5.0 tests select "b" as col1, "c" as col2; col1 col2 b c diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 631165d9fc8..997c7bae1d6 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -748,6 +748,8 @@ f1 f2 f3 111111 aaaaaa 1 222222 bbbbbb 2 drop table t1; +Illegal ndb error code: 1186 +Enf of 5.0 tests CREATE TABLE t1 (a VARCHAR(255) NOT NULL, CONSTRAINT pk_a PRIMARY KEY (a))engine=ndb; CREATE TABLE t2(a VARCHAR(255) NOT NULL, diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index a36935a583d..9756ab49ac7 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -280,6 +280,8 @@ info text NOT NULL default '', ipnr varchar(30) NOT NULL default '', PRIMARY KEY (member_id) ) ENGINE=MyISAM PACK_KEYS=1; +Warnings: +Warning 1101 BLOB/TEXT column 'info' can't have a default value insert into t1 (member_id) values (1),(2),(3); select member_id, nickname, voornaam FROM t1 ORDER by lastchange_datum DESC LIMIT 2; diff --git a/mysql-test/r/perror.result b/mysql-test/r/perror.result new file mode 100644 index 00000000000..4946523bc42 --- /dev/null +++ b/mysql-test/r/perror.result @@ -0,0 +1 @@ +Illegal error code: 10000 diff --git a/mysql-test/r/rpl_sp.result b/mysql-test/r/rpl_sp.result index 24c0a73c717..261e7cb072c 100644 --- a/mysql-test/r/rpl_sp.result +++ b/mysql-test/r/rpl_sp.result @@ -420,4 +420,48 @@ SELECT * FROM t1; col test DROP PROCEDURE p1; + +---> Test for BUG#20438 + +---> Preparing environment... +---> connection: master +DROP PROCEDURE IF EXISTS p1; +DROP FUNCTION IF EXISTS f1; + +---> Synchronizing slave with master... + +---> connection: master + +---> Creating procedure... +/*!50003 CREATE PROCEDURE p1() SET @a = 1 */; +/*!50003 CREATE FUNCTION f1() RETURNS INT RETURN 0 */; + +---> Checking on master... +SHOW CREATE PROCEDURE p1; +Procedure sql_mode Create Procedure +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 + +---> Synchronizing slave with master... +---> connection: master + +---> Checking on slave... +SHOW CREATE PROCEDURE p1; +Procedure sql_mode Create Procedure +p1 CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`() +SET @a = 1 +SHOW CREATE FUNCTION f1; +Function sql_mode Create Function +f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) +RETURN 0 + +---> connection: master + +---> Cleaning up... +DROP PROCEDURE p1; +DROP FUNCTION f1; drop table t1; diff --git a/mysql-test/r/rpl_trigger.result b/mysql-test/r/rpl_trigger.result index 53ec2c59cf3..bd6d6e63d57 100644 --- a/mysql-test/r/rpl_trigger.result +++ b/mysql-test/r/rpl_trigger.result @@ -899,3 +899,50 @@ Tables_in_test (t_) SHOW TRIGGERS; Trigger Event Table Statement Timing Created sql_mode Definer RESET MASTER; +START SLAVE; + +---> Test for BUG#20438 + +---> Preparing environment... +---> connection: master +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; + +---> Synchronizing slave with master... + +---> connection: master + +---> Creating objects... +CREATE TABLE t1(c INT); +CREATE TABLE t2(c INT); +/*!50003 CREATE TRIGGER t1_bi BEFORE INSERT ON t1 +FOR EACH ROW +INSERT INTO t2 VALUES(NEW.c * 10) */; + +---> Inserting value... +INSERT INTO t1 VALUES(1); + +---> Checking on master... +SELECT * FROM t1; +c +1 +SELECT * FROM t2; +c +10 + +---> Synchronizing slave with master... +---> connection: master + +---> Checking on slave... +SELECT * FROM t1; +c +1 +SELECT * FROM t2; +c +10 + +---> connection: master + +---> Cleaning up... +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/r/rpl_view.result b/mysql-test/r/rpl_view.result index f038f4d00cb..4e1a7153b65 100644 --- a/mysql-test/r/rpl_view.result +++ b/mysql-test/r/rpl_view.result @@ -43,3 +43,40 @@ drop view v1; select * from v1 order by a; ERROR 42S02: Table 'test.v1' doesn't exist drop table t1; + +---> Test for BUG#20438 + +---> Preparing environment... +---> connection: master +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; + +---> Synchronizing slave with master... + +---> connection: master + +---> Creating objects... +CREATE TABLE t1(c INT); +/*!50003 CREATE VIEW v1 AS SELECT * FROM t1 */; + +---> Inserting value... +INSERT INTO t1 VALUES(1); + +---> Checking on master... +SELECT * FROM t1; +c +1 + +---> Synchronizing slave with master... +---> connection: master + +---> Checking on slave... +SELECT * FROM t1; +c +1 + +---> connection: master + +---> Cleaning up... +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index f5b3fc99baf..465cb853581 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -692,3 +692,20 @@ Warning 1541 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL show plugin; show plugins; End of 5.1 tests +CREATE PROCEDURE p1() +BEGIN +SET @s= 'CREATE VIEW v1 AS SELECT SQL_CACHE 1'; +PREPARE stmt FROM @s; +EXECUTE stmt; +DROP PREPARE stmt; +END | +CALL p1(); +SHOW CREATE VIEW v1; +View Create View +v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_cache 1 AS `1` +DROP PROCEDURE p1; +DROP VIEW v1; +SHOW TABLES FROM no_such_database; +ERROR 42000: Unknown database 'no_such_database' +SHOW COLUMNS FROM no_such_table; +ERROR 42S02: Table 'test.no_such_table' doesn't exist diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result index 8bdb9a724d7..4ae38861d29 100644 --- a/mysql-test/r/sp-code.result +++ b/mysql-test/r/sp-code.result @@ -155,11 +155,11 @@ Pos Instruction 0 stmt 9 "drop temporary table if exists sudoku..." 1 stmt 1 "create temporary table sudoku_work ( ..." 2 stmt 1 "create temporary table sudoku_schedul..." -3 stmt 95 "call sudoku_init(" +3 stmt 95 "call sudoku_init()" 4 jump_if_not 7(8) p_naive@0 5 stmt 4 "update sudoku_work set cnt = 0 where ..." 6 jump 8 -7 stmt 95 "call sudoku_count(" +7 stmt 95 "call sudoku_count()" 8 stmt 6 "insert into sudoku_schedule (row,col)..." 9 set v_scounter@2 0 10 set v_i@3 1 @@ -199,3 +199,10 @@ Pos Instruction 44 jump 14 45 stmt 9 "drop temporary table sudoku_work, sud..." drop procedure sudoku_solve; +DROP PROCEDURE IF EXISTS p1; +CREATE PROCEDURE p1() CREATE INDEX idx ON t1 (c1); +SHOW PROCEDURE CODE p1; +Pos Instruction +0 stmt 2 "CREATE INDEX idx ON t1 (c1)" +DROP PROCEDURE p1; +End of 5.0 tests. diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 63401845f23..2b01415c2d0 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1174,6 +1174,19 @@ drop procedure bug15091; drop function if exists bug16896; create aggregate function bug16896() returns int return 1; ERROR 42000: AGGREGATE is not supported for stored functions +DROP PROCEDURE IF EXISTS bug14702; +CREATE IF NOT EXISTS PROCEDURE bug14702() +BEGIN +END; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS PROCEDURE bug14702() +BEGIN +END' at line 1 +CREATE PROCEDURE IF NOT EXISTS bug14702() +BEGIN +END; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS bug14702() +BEGIN +END' at line 1 drop function if exists bug16164; create function bug16164() returns int begin diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result index 4860058a8a1..5272bf47672 100644 --- a/mysql-test/r/sp-security.result +++ b/mysql-test/r/sp-security.result @@ -441,3 +441,55 @@ SELECT Host,User,Password FROM mysql.user WHERE User='user19857'; Host User Password localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C DROP USER user19857@localhost; +DROP TABLE IF EXISTS t1; +DROP VIEW IF EXISTS v1; +DROP FUNCTION IF EXISTS f_suid; +DROP PROCEDURE IF EXISTS p_suid; +DROP FUNCTION IF EXISTS f_evil; +DELETE FROM mysql.user WHERE user LIKE 'mysqltest\_%'; +DELETE FROM mysql.db WHERE user LIKE 'mysqltest\_%'; +DELETE FROM mysql.tables_priv WHERE user LIKE 'mysqltest\_%'; +DELETE FROM mysql.columns_priv WHERE user LIKE 'mysqltest\_%'; +FLUSH PRIVILEGES; +CREATE TABLE t1 (i INT); +CREATE FUNCTION f_suid(i INT) RETURNS INT SQL SECURITY DEFINER RETURN 0; +CREATE PROCEDURE p_suid(IN i INT) SQL SECURITY DEFINER SET @c:= 0; +CREATE USER mysqltest_u1@localhost; +GRANT EXECUTE ON test.* TO mysqltest_u1@localhost; +CREATE DEFINER=mysqltest_u1@localhost FUNCTION f_evil () RETURNS INT +SQL SECURITY INVOKER +BEGIN +SET @a:= CURRENT_USER(); +SET @b:= (SELECT COUNT(*) FROM t1); +RETURN @b; +END| +CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT f_evil(); +SELECT COUNT(*) FROM t1; +ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1' +SELECT f_evil(); +ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1' +SELECT @a, @b; +@a @b +mysqltest_u1@localhost NULL +SELECT f_suid(f_evil()); +ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1' +SELECT @a, @b; +@a @b +mysqltest_u1@localhost NULL +CALL p_suid(f_evil()); +ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1' +SELECT @a, @b; +@a @b +mysqltest_u1@localhost NULL +SELECT * FROM v1; +ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v1' +SELECT @a, @b; +@a @b +mysqltest_u1@localhost NULL +DROP VIEW v1; +DROP FUNCTION f_evil; +DROP USER mysqltest_u1@localhost; +DROP PROCEDURE p_suid; +DROP FUNCTION f_suid; +DROP TABLE t1; +End of 5.0 tests. diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result index 8ff180044df..e768ebe36b3 100644 --- a/mysql-test/r/sp.result +++ b/mysql-test/r/sp.result @@ -5057,6 +5057,205 @@ concat('data was: /', var1, '/') data was: /1/ drop table t3| drop procedure bug15217| +DROP PROCEDURE IF EXISTS bug21013 | +CREATE PROCEDURE bug21013(IN lim INT) +BEGIN +DECLARE i INT DEFAULT 0; +WHILE (i < lim) DO +SET @b = LOCATE(_latin1'b', @a, 1); +SET i = i + 1; +END WHILE; +END | +SET @a = _latin2"aaaaaaaaaa" | +CALL bug21013(10) | +DROP PROCEDURE bug21013 | +DROP DATABASE IF EXISTS mysqltest1| +DROP DATABASE IF EXISTS mysqltest2| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8| +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET utf8| +use mysqltest1| +CREATE FUNCTION bug16211_f1() RETURNS CHAR(10) +RETURN ""| +CREATE FUNCTION bug16211_f2() RETURNS CHAR(10) CHARSET koi8r +RETURN ""| +CREATE FUNCTION mysqltest2.bug16211_f3() RETURNS CHAR(10) +RETURN ""| +CREATE FUNCTION mysqltest2.bug16211_f4() RETURNS CHAR(10) CHARSET koi8r +RETURN ""| +SHOW CREATE FUNCTION bug16211_f1| +Function sql_mode Create Function +bug16211_f1 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f1`() RETURNS char(10) CHARSET utf8 +RETURN "" +SHOW CREATE FUNCTION bug16211_f2| +Function sql_mode Create Function +bug16211_f2 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f2`() RETURNS char(10) CHARSET koi8r +RETURN "" +SHOW CREATE FUNCTION mysqltest2.bug16211_f3| +Function sql_mode Create Function +bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f3`() RETURNS char(10) CHARSET utf8 +RETURN "" +SHOW CREATE FUNCTION mysqltest2.bug16211_f4| +Function sql_mode Create Function +bug16211_f4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f4`() RETURNS char(10) CHARSET koi8r +RETURN "" +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"| +dtd_identifier +char(10) CHARSET utf8 +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f2"| +dtd_identifier +char(10) CHARSET koi8r +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f3"| +dtd_identifier +char(10) CHARSET utf8 +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f4"| +dtd_identifier +char(10) CHARSET koi8r +SELECT CHARSET(bug16211_f1())| +CHARSET(bug16211_f1()) +utf8 +SELECT CHARSET(bug16211_f2())| +CHARSET(bug16211_f2()) +koi8r +SELECT CHARSET(mysqltest2.bug16211_f3())| +CHARSET(mysqltest2.bug16211_f3()) +utf8 +SELECT CHARSET(mysqltest2.bug16211_f4())| +CHARSET(mysqltest2.bug16211_f4()) +koi8r +ALTER DATABASE mysqltest1 CHARACTER SET cp1251| +ALTER DATABASE mysqltest2 CHARACTER SET cp1251| +SHOW CREATE FUNCTION bug16211_f1| +Function sql_mode Create Function +bug16211_f1 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f1`() RETURNS char(10) CHARSET utf8 +RETURN "" +SHOW CREATE FUNCTION bug16211_f2| +Function sql_mode Create Function +bug16211_f2 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f2`() RETURNS char(10) CHARSET koi8r +RETURN "" +SHOW CREATE FUNCTION mysqltest2.bug16211_f3| +Function sql_mode Create Function +bug16211_f3 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f3`() RETURNS char(10) CHARSET utf8 +RETURN "" +SHOW CREATE FUNCTION mysqltest2.bug16211_f4| +Function sql_mode Create Function +bug16211_f4 CREATE DEFINER=`root`@`localhost` FUNCTION `bug16211_f4`() RETURNS char(10) CHARSET koi8r +RETURN "" +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"| +dtd_identifier +char(10) CHARSET utf8 +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f2"| +dtd_identifier +char(10) CHARSET koi8r +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f3"| +dtd_identifier +char(10) CHARSET utf8 +SELECT dtd_identifier +FROM INFORMATION_SCHEMA.ROUTINES +WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f4"| +dtd_identifier +char(10) CHARSET koi8r +SELECT CHARSET(bug16211_f1())| +CHARSET(bug16211_f1()) +utf8 +SELECT CHARSET(bug16211_f2())| +CHARSET(bug16211_f2()) +koi8r +SELECT CHARSET(mysqltest2.bug16211_f3())| +CHARSET(mysqltest2.bug16211_f3()) +utf8 +SELECT CHARSET(mysqltest2.bug16211_f4())| +CHARSET(mysqltest2.bug16211_f4()) +koi8r +use test| +DROP DATABASE mysqltest1| +DROP DATABASE mysqltest2| +DROP DATABASE IF EXISTS mysqltest1| +CREATE DATABASE mysqltest1 DEFAULT CHARACTER SET utf8| +use mysqltest1| +CREATE PROCEDURE bug16676_p1( +IN p1 CHAR(10), +INOUT p2 CHAR(10), +OUT p3 CHAR(10)) +BEGIN +SELECT CHARSET(p1), COLLATION(p1); +SELECT CHARSET(p2), COLLATION(p2); +SELECT CHARSET(p3), COLLATION(p3); +END| +CREATE PROCEDURE bug16676_p2( +IN p1 CHAR(10) CHARSET koi8r, +INOUT p2 CHAR(10) CHARSET cp1251, +OUT p3 CHAR(10) CHARSET greek) +BEGIN +SELECT CHARSET(p1), COLLATION(p1); +SELECT CHARSET(p2), COLLATION(p2); +SELECT CHARSET(p3), COLLATION(p3); +END| +SET @v2 = 'b'| +SET @v3 = 'c'| +CALL bug16676_p1('a', @v2, @v3)| +CHARSET(p1) COLLATION(p1) +utf8 utf8_general_ci +CHARSET(p2) COLLATION(p2) +utf8 utf8_general_ci +CHARSET(p3) COLLATION(p3) +utf8 utf8_general_ci +CALL bug16676_p2('a', @v2, @v3)| +CHARSET(p1) COLLATION(p1) +koi8r koi8r_general_ci +CHARSET(p2) COLLATION(p2) +cp1251 cp1251_general_ci +CHARSET(p3) COLLATION(p3) +greek greek_general_ci +use test| +DROP DATABASE mysqltest1| +drop procedure if exists bug19862| +CREATE TABLE t11 (a INT)| +CREATE TABLE t12 (a INT)| +CREATE FUNCTION bug19862(x INT) RETURNS INT +BEGIN +INSERT INTO t11 VALUES (x); +RETURN x+1; +END| +INSERT INTO t12 VALUES (1), (2)| +SELECT bug19862(a) FROM t12 ORDER BY 1| +bug19862(a) +2 +3 +SELECT * FROM t11| +a +1 +2 +DROP TABLE t11, t12| +DROP FUNCTION bug19862| +drop table if exists t3| +drop database if exists mysqltest1| +create table t3 (a int)| +insert into t3 (a) values (1), (2)| +create database mysqltest1| +use mysqltest1| +drop database mysqltest1| +select database()| +database() +NULL +select * from (select 1 as a) as t1 natural join (select * from test.t3) as t2| +a +1 +use test| +drop table t3| drop table if exists t3| drop database if exists mysqltest1| create table t3 (a int)| diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index dd96dc6d983..4a8ca484329 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -5,7 +5,9 @@ select @@sql_mode; REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER DROP TABLE IF EXISTS t1; CREATE TABLE t1 (col1 date); -INSERT INTO t1 VALUES('2004-01-01'),('0000-10-31'),('2004-02-29'); +INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29'); +INSERT INTO t1 VALUES('0000-10-31'); +ERROR 22007: Incorrect date value: '0000-10-31' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-0-31'); ERROR 22007: Incorrect date value: '2004-0-31' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31'); @@ -54,7 +56,6 @@ Warning 1265 Data truncated for column 'col1' at row 3 select * from t1; col1 2004-01-01 -0000-10-31 2004-02-29 2004-01-02 2004-01-03 @@ -121,7 +122,9 @@ col1 drop table t1; set @@sql_mode='ansi,traditional'; CREATE TABLE t1 (col1 datetime); -INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('0000-10-31 15:30:00'),('2004-02-29 15:30:00'); +INSERT INTO t1 VALUES('2004-10-31 15:30:00'),('2004-02-29 15:30:00'); +INSERT INTO t1 VALUES('0000-10-31 15:30:00'); +ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-0-31 15:30:00'); ERROR 22007: Incorrect datetime value: '2004-0-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 VALUES('2004-10-0 15:30:00'); @@ -141,7 +144,6 @@ ERROR 22007: Incorrect datetime value: '59' for column 'col1' at row 1 select * from t1; col1 2004-10-31 15:30:00 -0000-10-31 15:30:00 2004-02-29 15:30:00 drop table t1; CREATE TABLE t1 (col1 timestamp); @@ -204,6 +206,7 @@ INSERT INTO t1 (col1) VALUES (STR_TO_DATE('15.10.2004','%d.%m.%Y')); INSERT INTO t1 (col2) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col3) VALUES (STR_TO_DATE('15.10.2004 10.15','%d.%m.%Y %H.%i')); INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); +ERROR 22007: Incorrect date value: '0000-10-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect date value: '2004-00-31 15:30:00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -219,6 +222,7 @@ ERROR HY000: Incorrect datetime value: '15.13.2004 15.30' for function str_to_ti INSERT INTO t1 (col1) VALUES(STR_TO_DATE('00.00.0000','%d.%m.%Y')); ERROR 22007: Incorrect date value: '0000-00-00' for column 'col1' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.10.0000 15.30','%d.%m.%Y %H.%i')); +ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('31.0.2004 15.30','%d.%m.%Y %H.%i')); ERROR 22007: Incorrect datetime value: '2004-00-31 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(STR_TO_DATE('0.10.2004 15.30','%d.%m.%Y %H.%i')); @@ -255,6 +259,7 @@ INSERT INTO t1 (col1) VALUES (CAST('2004-10-15' AS DATE)); INSERT INTO t1 (col2) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col3) VALUES (CAST('2004-10-15 10:15' AS DATETIME)); INSERT INTO t1 (col1) VALUES(CAST('0000-10-31' AS DATE)); +ERROR 22007: Truncated incorrect datetime value: '0000-10-31' INSERT INTO t1 (col1) VALUES(CAST('2004-10-0' AS DATE)); ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CAST('2004-0-10' AS DATE)); @@ -262,6 +267,7 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CAST('0000-00-00' AS DATE)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col2) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); +ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' INSERT INTO t1 (col2) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); @@ -269,7 +275,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); -ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 +ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); @@ -282,6 +288,7 @@ INSERT INTO t1 (col1) VALUES (CONVERT('2004-10-15',DATE)); INSERT INTO t1 (col2) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col3) VALUES (CONVERT('2004-10-15 10:15',DATETIME)); INSERT INTO t1 (col1) VALUES(CONVERT('0000-10-31' , DATE)); +ERROR 22007: Truncated incorrect datetime value: '0000-10-31' INSERT INTO t1 (col1) VALUES(CONVERT('2004-10-0' , DATE)); ERROR 22007: Incorrect date value: '2004-10-00' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CONVERT('2004-0-10' , DATE)); @@ -289,6 +296,7 @@ ERROR 22007: Incorrect date value: '2004-00-10' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(CONVERT('0000-00-00',DATE)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col2) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); +ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' INSERT INTO t1 (col2) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col2' at row 1 INSERT INTO t1 (col2) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); @@ -296,7 +304,7 @@ ERROR 22007: Incorrect datetime value: '2004-00-10 15:30:00' for column 'col2' a INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME)); ERROR 22007: Incorrect datetime value: '0000-00-00' INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); -ERROR 22007: Incorrect datetime value: '0000-10-31 15:30:00' for column 'col3' at row 1 +ERROR 22007: Truncated incorrect datetime value: '0000-10-31 15:30' INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); ERROR 22007: Incorrect datetime value: '2004-10-00 15:30:00' for column 'col3' at row 1 INSERT INTO t1 (col3) VALUES(CONVERT('2004-0-10 15:30',DATETIME)); diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index d05e9403d11..e5adad14267 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -503,6 +503,8 @@ foobar boggle fish 10 drop table t1; create table t1 (id integer auto_increment unique,imagem LONGBLOB not null default ''); +Warnings: +Warning 1101 BLOB/TEXT column 'imagem' can't have a default value insert into t1 (id) values (1); select charset(load_file('../../std_data/words.dat')), @@ -788,3 +790,21 @@ NULL 616100000000 620000000000 drop table t1; +create table t1 (a text default ''); +Warnings: +Warning 1101 BLOB/TEXT column 'a' can't have a default value +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values (default); +select * from t1; +a +NULL +drop table t1; +set @@sql_mode='TRADITIONAL'; +create table t1 (a text default ''); +ERROR 42000: BLOB/TEXT column 'a' can't have a default value +set @@sql_mode=''; +End of 5.0 tests diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 6f1a45f27c5..3ae224879df 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -26,6 +26,8 @@ Table Op Msg_type Msg_text test.t1 check status OK delete from t1; insert into t1 values("000101"),("691231"),("700101"),("991231"),("00000101"),("00010101"),("99991231"),("00101000000"),("691231000000"),("700101000000"),("991231235959"),("10000101000000"),("99991231235959"),("20030100000000"),("20030000000000"); +Warnings: +Warning 1264 Out of range value adjusted for column 't' at row 5 insert into t1 values ("2003-003-03"); insert into t1 values ("20030102T131415"),("2001-01-01T01:01:01"), ("2001-1-1T1:01:01"); select * from t1; @@ -34,7 +36,7 @@ t 2069-12-31 00:00:00 1970-01-01 00:00:00 1999-12-31 00:00:00 -0000-01-01 00:00:00 +0000-00-00 00:00:00 0001-01-01 00:00:00 9999-12-31 00:00:00 2000-10-10 00:00:00 diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 32bb6abf7ac..50867219fd8 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -38,6 +38,9 @@ KEY (ulong), KEY (ulonglong,ulong), KEY (options,flags) ); +Warnings: +Warning 1101 BLOB/TEXT column 'mediumblob_col' can't have a default value +Warning 1101 BLOB/TEXT column 'longblob_col' can't have a default value show full fields from t1; Field Type Collation Null Key Default Extra Privileges Comment auto int(5) unsigned NULL NO PRI NULL auto_increment # diff --git a/mysql-test/r/udf.result b/mysql-test/r/udf.result index 624895f71c9..a552282fece 100644 --- a/mysql-test/r/udf.result +++ b/mysql-test/r/udf.result @@ -93,6 +93,12 @@ NULL 0R FR DROP TABLE bug19904; +CREATE DEFINER=CURRENT_USER() FUNCTION should_not_parse +RETURNS STRING SONAME "should_not_parse.so"; +ERROR HY000: Incorrect usage of SONAME and DEFINER +CREATE DEFINER=someone@somewhere FUNCTION should_not_parse +RETURNS STRING SONAME "should_not_parse.so"; +ERROR HY000: Incorrect usage of SONAME and DEFINER create table t1(f1 int); insert into t1 values(1),(2); explain select myfunc_int(f1) from t1 order by 1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index b96f97b535c..42fbf0f6ff1 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1318,7 +1318,7 @@ t2 CREATE TABLE `t2` ( `f5` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', `f6` varchar(1) CHARACTER SET utf8 DEFAULT NULL, `f7` text, - `f8` text CHARACTER SET utf8 + `f8` mediumtext character set utf8 ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1, t2; (select avg(1)) union (select avg(1)) union (select avg(1)) union @@ -1366,3 +1366,8 @@ drop table t1, t2; (select avg(1)) union (select avg(1)) union (select avg(1)); avg(1) NULL +select _utf8'12' union select _latin1'12345'; +12 +12 +12345 +End of 5.0 tests diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 9c3fdf0d8d2..1ff2e9948bd 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -256,3 +256,39 @@ t1 CREATE TABLE `t1` ( `@first_var` longtext ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +set @a=18446744071710965857; +select @a; +@a +18446744071710965857 +CREATE TABLE `bigfailure` ( +`afield` BIGINT UNSIGNED NOT NULL +); +INSERT INTO `bigfailure` VALUES (18446744071710965857); +SELECT * FROM bigfailure; +afield +18446744071710965857 +select * from (SELECT afield FROM bigfailure) as b; +afield +18446744071710965857 +select * from bigfailure where afield = (SELECT afield FROM bigfailure); +afield +18446744071710965857 +select * from bigfailure where afield = 18446744071710965857; +afield +18446744071710965857 +select * from bigfailure where afield = 18446744071710965856+1; +afield +18446744071710965857 +SET @a := (SELECT afield FROM bigfailure); +SELECT @a; +@a +18446744071710965857 +SET @a := (select afield from (SELECT afield FROM bigfailure) as b); +SELECT @a; +@a +18446744071710965857 +SET @a := (select * from bigfailure where afield = (SELECT afield FROM bigfailure)); +SELECT @a; +@a +18446744071710965857 +drop table bigfailure; |