summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-12-11 12:39:38 +0300
committerAlexander Nozdrin <alik@sun.com>2009-12-11 12:39:38 +0300
commit567671368723c704d60902b4d0ccff951b414552 (patch)
tree965519a5b0af3f33624c7e16fd61b58d15f42372 /mysql-test/r
parentefee0608316e4cc034a3e62d05980eef8530843d (diff)
parentceefe7bb50b17b72e88851e3b98642e89a4cddae (diff)
downloadmariadb-git-567671368723c704d60902b4d0ccff951b414552.tar.gz
Manual merge from mysql-trunk.
Conflicts: - client/mysqltest.cc - mysql-test/collections/default.experimental - mysql-test/suite/rpl/t/disabled.def - sql/mysqld.cc - sql/opt_range.cc - sql/sp.cc - sql/sql_acl.cc - sql/sql_partition.cc - sql/sql_table.cc
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/alter_table.result8
-rw-r--r--mysql-test/r/bench_count_distinct.result2
-rw-r--r--mysql-test/r/bigint.result6
-rw-r--r--mysql-test/r/cast.result2
-rw-r--r--mysql-test/r/compare.result4
-rw-r--r--mysql-test/r/create.result34
-rw-r--r--mysql-test/r/ctype_collate.result30
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result14
-rw-r--r--mysql-test/r/ctype_errors.result32
-rw-r--r--mysql-test/r/ctype_ldml.result38
-rw-r--r--mysql-test/r/ctype_recoding.result4
-rw-r--r--mysql-test/r/ctype_ucs2_def.result2
-rw-r--r--mysql-test/r/ctype_utf8.result210
-rw-r--r--mysql-test/r/date_formats.result64
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result122
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result122
-rw-r--r--mysql-test/r/debug_sync.result2
-rw-r--r--mysql-test/r/delayed.result24
-rw-r--r--mysql-test/r/drop-no_root.result28
-rw-r--r--mysql-test/r/drop.result14
-rw-r--r--mysql-test/r/drop_debug.result21
-rw-r--r--mysql-test/r/errors.result29
-rw-r--r--mysql-test/r/events_1.result40
-rw-r--r--mysql-test/r/events_2.result10
-rw-r--r--mysql-test/r/events_bugs.result32
-rw-r--r--mysql-test/r/events_grant.result42
-rw-r--r--mysql-test/r/explain.result26
-rw-r--r--mysql-test/r/flush_block_commit_notembedded.result4
-rw-r--r--mysql-test/r/fulltext.result8
-rw-r--r--mysql-test/r/func_compress.result14
-rw-r--r--mysql-test/r/func_default.result2
-rw-r--r--mysql-test/r/func_encrypt.result8
-rw-r--r--mysql-test/r/func_encrypt_nossl.result42
-rw-r--r--mysql-test/r/func_gconcat.result64
-rw-r--r--mysql-test/r/func_math.result13
-rw-r--r--mysql-test/r/func_regexp.result2
-rw-r--r--mysql-test/r/func_sapdb.result2
-rw-r--r--mysql-test/r/func_str.result389
-rw-r--r--mysql-test/r/func_test.result2
-rw-r--r--mysql-test/r/func_time.result2
-rw-r--r--mysql-test/r/grant.result759
-rw-r--r--mysql-test/r/grant2.result6
-rw-r--r--mysql-test/r/grant4.result123
-rw-r--r--mysql-test/r/group_min_max.result270
-rw-r--r--mysql-test/r/have_community_features.require2
-rw-r--r--mysql-test/r/have_nodebug.require2
-rw-r--r--mysql-test/r/have_profiling.require2
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/information_schema-big.result93
-rw-r--r--mysql-test/r/information_schema.result292
-rw-r--r--mysql-test/r/information_schema_db.result16
-rw-r--r--mysql-test/r/information_schema_inno.result26
-rw-r--r--mysql-test/r/information_schema_part.result56
-rw-r--r--mysql-test/r/innodb.result2
-rw-r--r--mysql-test/r/innodb_mysql.result20
-rw-r--r--mysql-test/r/insert.result44
-rw-r--r--mysql-test/r/join.result4
-rw-r--r--mysql-test/r/join_optimizer.result37
-rw-r--r--mysql-test/r/join_outer.result12
-rw-r--r--mysql-test/r/key.result8
-rw-r--r--mysql-test/r/loadxml.result75
-rw-r--r--mysql-test/r/locale.result63
-rw-r--r--mysql-test/r/lock_sync.result66
-rw-r--r--mysql-test/r/log_state.result24
-rw-r--r--mysql-test/r/log_state_bug33693.result3
-rw-r--r--mysql-test/r/lowercase_fs_off.result4
-rw-r--r--mysql-test/r/lowercase_table2.result71
-rw-r--r--mysql-test/r/merge.result40
-rw-r--r--mysql-test/r/metadata.result96
-rw-r--r--mysql-test/r/multi_update.result4
-rw-r--r--mysql-test/r/myisam-system.result2
-rw-r--r--mysql-test/r/mysql.result2
-rw-r--r--mysql-test/r/mysql_locale_posix.result72
-rw-r--r--mysql-test/r/mysql_upgrade.result1
-rw-r--r--mysql-test/r/mysqlcheck.result8
-rw-r--r--mysql-test/r/mysqldump.result34
-rw-r--r--mysql-test/r/outfile.resultbin2149 -> 2137 bytes
-rw-r--r--mysql-test/r/partition.result9
-rw-r--r--mysql-test/r/partition_column.result578
-rw-r--r--mysql-test/r/partition_column_prune.result66
-rw-r--r--mysql-test/r/partition_datatype.result8
-rw-r--r--mysql-test/r/partition_error.result13
-rw-r--r--mysql-test/r/partition_hash.result2
-rw-r--r--mysql-test/r/partition_innodb.result35
-rw-r--r--mysql-test/r/partition_list.result11
-rw-r--r--mysql-test/r/partition_mgm_err.result2
-rw-r--r--mysql-test/r/partition_pruning.result348
-rw-r--r--mysql-test/r/partition_range.result93
-rw-r--r--mysql-test/r/partition_truncate.result18
-rw-r--r--mysql-test/r/partition_utf8.result53
-rw-r--r--mysql-test/r/plugin.result9
-rw-r--r--mysql-test/r/profiling.result7
-rw-r--r--mysql-test/r/ps.result171
-rw-r--r--mysql-test/r/ps_1general.result3
-rw-r--r--mysql-test/r/ps_2myisam.result42
-rw-r--r--mysql-test/r/ps_3innodb.result42
-rw-r--r--mysql-test/r/ps_4heap.result42
-rw-r--r--mysql-test/r/ps_5merge.result84
-rw-r--r--mysql-test/r/query_cache.result8
-rw-r--r--mysql-test/r/query_cache_disabled.result14
-rw-r--r--mysql-test/r/query_cache_ps_no_prot.result41
-rw-r--r--mysql-test/r/query_cache_ps_ps_prot.result41
-rw-r--r--mysql-test/r/range.result6
-rw-r--r--mysql-test/r/select.result2
-rw-r--r--mysql-test/r/show_check.result369
-rw-r--r--mysql-test/r/signal.result2362
-rw-r--r--mysql-test/r/signal_code.result35
-rw-r--r--mysql-test/r/signal_demo1.result270
-rw-r--r--mysql-test/r/signal_demo2.result197
-rw-r--r--mysql-test/r/signal_demo3.result143
-rw-r--r--mysql-test/r/signal_sqlmode.result86
-rw-r--r--mysql-test/r/sp-code.result4
-rw-r--r--mysql-test/r/sp-dynamic.result8
-rw-r--r--mysql-test/r/sp-no-code.result4
-rw-r--r--mysql-test/r/sp-security.result4
-rw-r--r--mysql-test/r/sp-vars.result97
-rw-r--r--mysql-test/r/sp.result90
-rw-r--r--mysql-test/r/sp_notembedded.result2
-rw-r--r--mysql-test/r/sp_trans.result27
-rw-r--r--mysql-test/r/sp_trans_log.result10
-rw-r--r--mysql-test/r/sql_mode.result6
-rw-r--r--mysql-test/r/strict.result54
-rw-r--r--mysql-test/r/subselect.result10
-rw-r--r--mysql-test/r/subselect3.result2
-rw-r--r--mysql-test/r/system_mysql_db.result3
-rw-r--r--mysql-test/r/trigger-compat.result4
-rw-r--r--mysql-test/r/trigger.result41
-rw-r--r--mysql-test/r/trigger_notembedded.result14
-rw-r--r--mysql-test/r/type_binary.result2
-rw-r--r--mysql-test/r/type_bit.result2
-rw-r--r--mysql-test/r/type_date.result22
-rw-r--r--mysql-test/r/type_datetime.result4
-rw-r--r--mysql-test/r/type_decimal.result14
-rw-r--r--mysql-test/r/type_newdecimal.result76
-rw-r--r--mysql-test/r/type_varchar.result20
-rw-r--r--mysql-test/r/variables.result197
-rw-r--r--mysql-test/r/view.result24
-rw-r--r--mysql-test/r/view_grant.result20
-rw-r--r--mysql-test/r/warnings.result4
139 files changed, 8459 insertions, 1371 deletions
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 06f4e7fbe8a..15171798279 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1339,3 +1339,11 @@ affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
DROP TABLE t1;
End of 5.1 tests
+CREATE TABLE t1(c CHAR(10),
+i INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY);
+INSERT INTO t1 VALUES('a',2),('b',4),('c',6);
+ALTER TABLE t1
+DROP i,
+ADD i INT UNSIGNED NOT NULL AUTO_INCREMENT,
+AUTO_INCREMENT = 1;
+DROP TABLE t1;
diff --git a/mysql-test/r/bench_count_distinct.result b/mysql-test/r/bench_count_distinct.result
index 79e12afd237..8b67e4be38a 100644
--- a/mysql-test/r/bench_count_distinct.result
+++ b/mysql-test/r/bench_count_distinct.result
@@ -5,7 +5,7 @@ count(distinct n)
100
explain extended select count(distinct n) from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index NULL n 4 NULL 200 100.00 Using index
+1 SIMPLE t1 range NULL n 4 NULL 10 100.00 Using index for group-by
Warnings:
Note 1003 select count(distinct `test`.`t1`.`n`) AS `count(distinct n)` from `test`.`t1`
drop table t1;
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 4a5b8fcf4aa..6b0954655e9 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -362,12 +362,12 @@ select cast(19999999999999999999 as signed);
cast(19999999999999999999 as signed)
9223372036854775807
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select cast(-19999999999999999999 as signed);
cast(-19999999999999999999 as signed)
-9223372036854775808
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select -9223372036854775808;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def -9223372036854775808 8 20 20 N 32897 0 63
@@ -385,7 +385,7 @@ def -((9223372036854775808)) 8 20 20 N 32897 0 63
-9223372036854775808
select -(-(9223372036854775808));
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def -(-(9223372036854775808)) 246 21 19 N 129 0 63
+def -(-(9223372036854775808)) 246 21 19 N 32897 0 63
-(-(9223372036854775808))
9223372036854775808
select --9223372036854775808, ---9223372036854775808, ----9223372036854775808;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index dd61396e485..c53de220b60 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -380,7 +380,7 @@ select cast(s1 as decimal(7,2)) from t1;
cast(s1 as decimal(7,2))
99999.99
Warnings:
-Error 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
+Warning 1264 Out of range value for column 'cast(s1 as decimal(7,2))' at row 1
drop table t1;
CREATE TABLE t1 (v varchar(10), tt tinytext, t text,
mt mediumtext, lt longtext);
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index f9563b89b76..d931879ce23 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -47,11 +47,11 @@ insert into t1 values (0x01,0x01);
select * from t1 where a=b;
a b
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x01'
select * from t1 where a=b and b=0x01;
a b
Warnings:
-Warning 1292 Truncated incorrect DOUBLE value: ''
+Warning 1292 Truncated incorrect DOUBLE value: '\x01'
drop table if exists t1;
CREATE TABLE t1 (b int(2) zerofill, c int(2) zerofill);
INSERT INTO t1 (b,c) VALUES (1,2), (1,1), (2,2);
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index b829ef30fb1..471cc6e9a3d 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -1922,3 +1922,37 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
# -- End of Bug#45829
End of 5.1 tests
+
+# --
+# -- Bug #43054 Assertion `!table->auto_increment_field_not_null'
+# -- failed when redefining trigger
+
+CREATE TABLE B (
+pk INTEGER AUTO_INCREMENT,
+int_key INTEGER NOT NULL,
+PRIMARY KEY (pk),
+KEY (int_key)
+);
+INSERT IGNORE INTO B VALUES ('9', '9');
+CREATE TABLE IF NOT EXISTS t1 (
+`pk` INTEGER NOT NULL AUTO_INCREMENT ,
+`int` INTEGER ,
+PRIMARY KEY ( `pk` )
+) SELECT `pk` , `int_key` FROM B ;
+CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+INSERT INTO t1 ( `int` ) VALUES (4 ),( 8 ),( 2 ) ;
+END ; |
+CREATE TABLE IF NOT EXISTS t1 (
+`pk` INTEGER NOT NULL AUTO_INCREMENT ,
+`int` INTEGER ,
+PRIMARY KEY ( `pk` )
+) SELECT `pk` , `int_key` FROM B ;
+ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
+CREATE TRIGGER f BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+UPDATE A SET `pk`=1 WHERE `pk`=0 ;
+END ;|
+ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
+DROP TABLE t1;
+DROP TABLE B;
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index b42094550bd..67262a4935d 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -548,6 +548,36 @@ SELECT * FROM t1 WHERE s2 = s3;
s1 s2 s3
a A A
DROP TABLE t1;
+create table t1 (a varchar(1) character set latin1 collate latin1_general_ci);
+insert into t1 values ('A'),('a'),('B'),('b'),('C'),('c');
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+create index i on t1 (a);
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+drop table t1;
SET NAMES latin1;
CREATE TABLE t1
(s1 char(10) COLLATE latin1_german1_ci,
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index 044885d1ea7..bb971e5453b 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -29,22 +29,22 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 370|
+SHOW BINLOG EVENTS FROM 371|
Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 370 Query 1 536 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
+master-bin.000001 371 Query 1 537 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))
-master-bin.000001 536 Query 1 785 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
+master-bin.000001 537 Query 1 786 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50),
IN ins2 CHAR(50) CHARACTER SET cp932,
IN ind DECIMAL(10,2))
BEGIN
INSERT INTO t4 VALUES (ins1, ins2, ind);
END
-master-bin.000001 785 Query 1 1049 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
-master-bin.000001 1049 Query 1 1138 use `test`; DROP PROCEDURE bug18293
-master-bin.000001 1138 Query 1 1217 use `test`; DROP TABLE t4
+master-bin.000001 786 Query 1 1050 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93))
+master-bin.000001 1050 Query 1 1139 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1139 Query 1 1218 use `test`; DROP TABLE t4
End of 5.0 tests
-SHOW BINLOG EVENTS FROM 365;
+SHOW BINLOG EVENTS FROM 366;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
CREATE TABLE t1 (a varchar(16)) character set cp932;
diff --git a/mysql-test/r/ctype_errors.result b/mysql-test/r/ctype_errors.result
new file mode 100644
index 00000000000..d8218e40e6f
--- /dev/null
+++ b/mysql-test/r/ctype_errors.result
@@ -0,0 +1,32 @@
+Start of 5.4 tests
+CREATE TABLE t1(f1 INT);
+SET lc_messages=ru_RU;
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages ru_RU
+CREATE TABLE t1(f1 INT);
+ERROR 42S01: \0422\0430\0431\043B\0438\0446\0430 't1' \0443\0436\0435 \0441\0443\0449\0435\0441\0442\0432\0443\0435\0442
+SET NAMES utf8;
+CREATE TABLE t1(f1 INT);
+ERROR 42S01: ТаблОца 't1' уже существует
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages en_US
+CREATE TABLE t1(f1 INT);
+ERROR 42S01: Table 't1' already exists
+SHOW GLOBAL VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages en_US
+SET GLOBAL lc_messages=ru_RU;
+SHOW GLOBAL VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages ru_RU
+SET GLOBAL lc_messages=en_US;
+DROP TABLE t1;
+drop table `ק`;
+ERROR 42S02: Unknown table 'ק'
+SET lc_messages=cs_CZ;
+SET NAMES UTF8;
+USE nonexistant;
+ERROR 42000: Nezn-Bámá databáze 'nonexistant'
+End of 5.4 tests
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
index d5585dcfad9..00da0db1735 100644
--- a/mysql-test/r/ctype_ldml.result
+++ b/mysql-test/r/ctype_ldml.result
@@ -5,7 +5,7 @@ Variable_name Value
character_sets_dir MYSQL_TEST_DIR/std_data/
show collation like 'utf8_test_ci';
Collation Charset Id Default Compiled Sortlen
-utf8_test_ci utf8 240 8
+utf8_test_ci utf8 353 8
create table t1 (c1 char(1) character set utf8 collate utf8_test_ci);
insert into t1 values ('a');
select * from t1 where c1='b';
@@ -14,7 +14,7 @@ a
drop table t1;
show collation like 'ucs2_test_ci';
Collation Charset Id Default Compiled Sortlen
-ucs2_test_ci ucs2 241 8
+ucs2_test_ci ucs2 358 8
create table t1 (c1 char(1) character set ucs2 collate ucs2_test_ci);
insert into t1 values ('a');
select * from t1 where c1='b';
@@ -56,9 +56,10 @@ INSERT INTO t1 SELECT REPEAT('a',11);
Warnings:
Warning 1265 Data truncated for column 'c1' at row 1
DROP TABLE t1;
+Vietnamese experimental collation
show collation like 'ucs2_vn_ci';
Collation Charset Id Default Compiled Sortlen
-ucs2_vn_ci ucs2 242 8
+ucs2_vn_ci ucs2 359 8
create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
insert into t1 values (0x0061),(0x0041),(0x00E0),(0x00C0),(0x1EA3),(0x1EA2),
(0x00E3),(0x00C3),(0x00E1),(0x00C1),(0x1EA1),(0x1EA0);
@@ -337,3 +338,34 @@ latin1_test latin1 99 Yes 1
select "foo" = "foo " collate latin1_test;
"foo" = "foo " collate latin1_test
1
+The following tests check that two-byte collation IDs work
+select * from information_schema.collations where id>256 order by id;
+COLLATION_NAME CHARACTER_SET_NAME ID IS_DEFAULT IS_COMPILED SORTLEN
+utf8_test_ci utf8 353 8
+ucs2_test_ci ucs2 358 8
+ucs2_vn_ci ucs2 359 8
+utf8_maxuserid_ci utf8 2047 8
+show collation like '%test%';
+Collation Charset Id Default Compiled Sortlen
+latin1_test latin1 99 Yes 1
+utf8_test_ci utf8 353 8
+ucs2_test_ci ucs2 358 8
+show collation like 'ucs2_vn_ci';
+Collation Charset Id Default Compiled Sortlen
+ucs2_vn_ci ucs2 359 8
+create table t1 (c1 char(1) character set ucs2 collate ucs2_vn_ci);
+insert into t1 values (0x0061);
+set @@character_set_results=NULL;
+select * from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 c1 c1 254 2 2 Y 0 0 359
+c1
+
+drop table t1;
+CREATE TABLE t1 (s1 char(10) character set utf8 collate utf8_maxuserid_ci);
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1;
+s1
+a
+b
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index ee95812c03e..15eb0ad2c55 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -162,10 +162,10 @@ Field Type Null Key Default Extra
DROP TABLE t1;
SET NAMES binary;
CREATE TABLE `goodÐÌÏÈÏ` (a int);
-ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
+ERROR HY000: Invalid utf8 character string: 'good\xD0\xCC\xCF\xC8\xCF'
SET NAMES utf8;
CREATE TABLE `goodÐÌÏÈÏ` (a int);
-ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ'
+ERROR HY000: Invalid utf8 character string: 'good\xD0\xCC\xCF\xC8\xCF'
set names latin1;
create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test');
diff --git a/mysql-test/r/ctype_ucs2_def.result b/mysql-test/r/ctype_ucs2_def.result
index 005d46062fb..af69a9e77d6 100644
--- a/mysql-test/r/ctype_ucs2_def.result
+++ b/mysql-test/r/ctype_ucs2_def.result
@@ -19,7 +19,7 @@ col2 VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin NOT NULL,
UNIQUE KEY key1 USING HASH (col1, col2)) ENGINE=MEMORY;
INSERT INTO t1 VALUES('A', 'A'), ('B', 'B'), ('C', 'C');
INSERT INTO t1 VALUES('A ', 'A ');
-ERROR 23000: Duplicate entry '' for key 'key1'
+ERROR 23000: Duplicate entry 'A -A ' for key 'key1'
DROP TABLE t1;
CREATE TABLE t1 (
c1 CHAR(255) CHARACTER SET UCS2 COLLATE UCS2_BIN NOT NULL,
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 6f4ae965ca0..4ff48bd380a 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -363,9 +363,9 @@ create table t1 (c varchar(30) character set utf8, unique(c(10)));
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
c1
@@ -396,9 +396,9 @@ create table t1 (c varchar(30) character set utf8, unique(c(10))) engine=innodb;
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
c1
@@ -430,19 +430,19 @@ insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
insert into t1 values ('b');
insert into t1 values ('bb');
insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
insert into t1 values ('а');
insert into t1 values ('аа');
insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
insert into t1 values ('б');
insert into t1 values ('бб');
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
insert into t1 values ('ꪪꪪꪪ');
@@ -453,19 +453,19 @@ insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
insert into t1 values ('b');
insert into t1 values ('bb');
insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
insert into t1 values ('а');
insert into t1 values ('аа');
insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
insert into t1 values ('б');
insert into t1 values ('бб');
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
insert into t1 values ('ꪪꪪꪪ');
@@ -483,14 +483,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -519,14 +519,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -549,14 +549,14 @@ unique key a (c(1))
) engine=innodb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -577,9 +577,9 @@ create table t1 (c varchar(30) character set utf8 collate utf8_bin, unique(c(10)
insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z');
insert into t1 values ('aaaaaaaaaa');
insert into t1 values ('aaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values ('aaaaaaaaaaaa');
-ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 'c'
+ERROR 23000: Duplicate entry 'aaaaaaaaaa' for key 'c'
insert into t1 values (repeat('b',20));
select c c1 from t1 where c='1';
c1
@@ -611,19 +611,19 @@ insert into t1 values ('1'),('2'),('3'),('4'),('x'),('y'),('z');
insert into t1 values ('a');
insert into t1 values ('aa');
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'c'
+ERROR 23000: Duplicate entry 'aa' for key 'c'
insert into t1 values ('b');
insert into t1 values ('bb');
insert into t1 values ('bbb');
-ERROR 23000: Duplicate entry 'bbb' for key 'c'
+ERROR 23000: Duplicate entry 'bb' for key 'c'
insert into t1 values ('а');
insert into t1 values ('аа');
insert into t1 values ('ааа');
-ERROR 23000: Duplicate entry 'ааа' for key 'c'
+ERROR 23000: Duplicate entry 'аа' for key 'c'
insert into t1 values ('б');
insert into t1 values ('бб');
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'ббб' for key 'c'
+ERROR 23000: Duplicate entry 'бб' for key 'c'
insert into t1 values ('ꪪ');
insert into t1 values ('ꪪꪪ');
insert into t1 values ('ꪪꪪꪪ');
@@ -641,14 +641,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -677,14 +677,14 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -707,14 +707,14 @@ unique key a (c(1))
) engine=innodb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
-ERROR 23000: Duplicate entry 'aa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('aaa');
-ERROR 23000: Duplicate entry 'aaa' for key 'a'
+ERROR 23000: Duplicate entry 'a' for key 'a'
insert into t1 values ('б');
insert into t1 values ('бб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
insert into t1 values ('ббб');
-ERROR 23000: Duplicate entry 'бÐ' for key 'a'
+ERROR 23000: Duplicate entry 'б' for key 'a'
select c as c_all from t1 order by c;
c_all
a
@@ -1631,27 +1631,27 @@ select char(0xff,0x8f using utf8);
char(0xff,0x8f using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
select char(195 using utf8);
char(195 using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'C3'
+Warning 1300 Invalid utf8 character string: 'C3'
select char(196 using utf8);
char(196 using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'C4'
+Warning 1300 Invalid utf8 character string: 'C4'
select char(2557 using utf8);
char(2557 using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FD'
+Warning 1300 Invalid utf8 character string: 'FD'
select convert(char(0xff,0x8f) using utf8);
convert(char(0xff,0x8f) using utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
select hex(convert(char(2557 using latin1) using utf8));
hex(convert(char(2557 using latin1) using utf8))
09C3BD
@@ -1815,12 +1815,12 @@ select hex(char(0xFF using utf8));
hex(char(0xFF using utf8))
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF'
+Warning 1300 Invalid utf8 character string: 'FF'
select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF'
+Warning 1300 Invalid utf8 character string: 'FF'
select hex(_utf8 0x616263FF);
ERROR HY000: Invalid utf8 character string: 'FF'
select hex(_utf8 X'616263FF');
@@ -1880,3 +1880,115 @@ CONVERT(a, CHAR) CONVERT(b, CHAR)
70000 1092
DROP TABLE t1;
End of 5.0 tests
+Start of 5.4 tests
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (
+predicted_order int NOT NULL,
+utf8_encoding VARCHAR(10) NOT NULL
+) CHARACTER SET utf8;
+INSERT INTO t1 VALUES (19, x'E0B696'), (30, x'E0B69AE0B798'), (61, x'E0B6AF'), (93, x'E0B799'), (52, x'E0B6A6'), (73, x'E0B6BBE0B78AE2808D'), (3, x'E0B686'), (56, x'E0B6AA'), (55, x'E0B6A9'), (70, x'E0B6B9'), (94, x'E0B79A'), (80, x'E0B785'), (25, x'E0B69AE0B791'), (48, x'E0B6A2'), (13, x'E0B690'), (86, x'E0B793'), (91, x'E0B79F'), (81, x'E0B786'), (79, x'E0B784'), (14, x'E0B691'), (99, x'E0B78A'), (8, x'E0B68B'), (68, x'E0B6B7'), (22, x'E0B69A'), (16, x'E0B693'), (33, x'E0B69AE0B7B3'), (38, x'E0B69AE0B79D'), (21, x'E0B683'), (11, x'E0B68E'), (77, x'E0B782'), (40, x'E0B69AE0B78A'), (101, x'E0B78AE2808DE0B6BB'), (35, x'E0B69AE0B79A'), (1, x'E0B7B4'), (9, x'E0B68C'), (96, x'E0B79C'), (6, x'E0B689'), (95, x'E0B79B'), (88, x'E0B796'), (64, x'E0B6B3'), (26, x'E0B69AE0B792'), (82, x'E0B78F'), (28, x'E0B69AE0B794'), (39, x'E0B69AE0B79E'), (97, x'E0B79D'), (2, x'E0B685'), (75, x'E0B780'), (34, x'E0B69AE0B799'), (69, x'E0B6B8'), (83, x'E0B790'), (18, x'E0B695'), (90, x'E0B7B2'), (17, x'E0B694'), (72, x'E0B6BB'), (66, x'E0B6B5'), (59, x'E0B6AD'), (44, x'E0B69E'), (15, x'E0B692'), (23, x'E0B69AE0B78F'), (65, x'E0B6B4'), (42, x'E0B69C'), (63, x'E0B6B1'), (85, x'E0B792'), (47, x'E0B6A1'), (49, x'E0B6A3'), (92, x'E0B7B3'), (78, x'E0B783'), (36, x'E0B69AE0B79B'), (4, x'E0B687'), (24, x'E0B69AE0B790'), (87, x'E0B794'), (37, x'E0B69AE0B79C'), (32, x'E0B69AE0B79F'), (29, x'E0B69AE0B796'), (43, x'E0B69D'), (62, x'E0B6B0'), (100, x'E0B78AE2808DE0B6BA'), (60, x'E0B6AE'), (45, x'E0B69F'), (12, x'E0B68F'), (46, x'E0B6A0'), (50, x'E0B6A5'), (51, x'E0B6A4'), (5, x'E0B688'), (76, x'E0B781'), (89, x'E0B798'), (74, x'E0B6BD'), (10, x'E0B68D'), (57, x'E0B6AB'), (71, x'E0B6BA'), (58, x'E0B6AC'), (27, x'E0B69AE0B793'), (54, x'E0B6A8'), (84, x'E0B791'), (31, x'E0B69AE0B7B2'), (98, x'E0B79E'), (53, x'E0B6A7'), (41, x'E0B69B'), (67, x'E0B6B6'), (7, x'E0B68A'), (20, x'E0B682');
+SELECT predicted_order, hex(utf8_encoding) FROM t1 ORDER BY utf8_encoding COLLATE utf8_sinhala_ci;
+predicted_order hex(utf8_encoding)
+1 E0B7B4
+2 E0B685
+3 E0B686
+4 E0B687
+5 E0B688
+6 E0B689
+7 E0B68A
+8 E0B68B
+9 E0B68C
+10 E0B68D
+11 E0B68E
+12 E0B68F
+13 E0B690
+14 E0B691
+15 E0B692
+16 E0B693
+17 E0B694
+18 E0B695
+19 E0B696
+20 E0B682
+21 E0B683
+22 E0B69A
+23 E0B69AE0B78F
+24 E0B69AE0B790
+25 E0B69AE0B791
+26 E0B69AE0B792
+27 E0B69AE0B793
+28 E0B69AE0B794
+29 E0B69AE0B796
+30 E0B69AE0B798
+31 E0B69AE0B7B2
+32 E0B69AE0B79F
+33 E0B69AE0B7B3
+34 E0B69AE0B799
+35 E0B69AE0B79A
+36 E0B69AE0B79B
+37 E0B69AE0B79C
+38 E0B69AE0B79D
+39 E0B69AE0B79E
+40 E0B69AE0B78A
+41 E0B69B
+42 E0B69C
+43 E0B69D
+44 E0B69E
+45 E0B69F
+46 E0B6A0
+47 E0B6A1
+48 E0B6A2
+49 E0B6A3
+50 E0B6A5
+51 E0B6A4
+52 E0B6A6
+53 E0B6A7
+54 E0B6A8
+55 E0B6A9
+56 E0B6AA
+57 E0B6AB
+58 E0B6AC
+59 E0B6AD
+60 E0B6AE
+61 E0B6AF
+62 E0B6B0
+63 E0B6B1
+64 E0B6B3
+65 E0B6B4
+66 E0B6B5
+67 E0B6B6
+68 E0B6B7
+69 E0B6B8
+70 E0B6B9
+71 E0B6BA
+72 E0B6BB
+73 E0B6BBE0B78AE2808D
+74 E0B6BD
+75 E0B780
+76 E0B781
+77 E0B782
+78 E0B783
+79 E0B784
+80 E0B785
+81 E0B786
+82 E0B78F
+83 E0B790
+84 E0B791
+85 E0B792
+86 E0B793
+87 E0B794
+88 E0B796
+89 E0B798
+90 E0B7B2
+91 E0B79F
+92 E0B7B3
+93 E0B799
+94 E0B79A
+95 E0B79B
+96 E0B79C
+97 E0B79D
+98 E0B79E
+99 E0B78A
+100 E0B78AE2808DE0B6BA
+101 E0B78AE2808DE0B6BB
+DROP TABLE t1;
+End of 5.4 tests
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 7e185daa668..b0b8316fe33 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -89,7 +89,7 @@ select STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T');
STR_TO_DATE('2004.12.12 22.30.61','%Y.%m.%d %T')
NULL
Warnings:
-Error 1411 Incorrect time value: '22.30.61' for function str_to_date
+Warning 1411 Incorrect time value: '22.30.61' for function str_to_date
create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
@@ -361,21 +361,21 @@ Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Warnings:
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
-Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
select date,format,concat(str_to_date(date, format),'') as con from t1;
date format con
2003-01-02 10:11:12 PM %Y-%m-%d %H:%i:%S %p NULL
@@ -395,21 +395,21 @@ Tuesday 52 2001 %W %u %x NULL
7 53 1998 %w %u %Y NULL
NULL %m.%d.%Y NULL
Warnings:
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
-Error 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
-Error 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
-Error 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
-Error 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
-Error 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12.123456' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12AN' for function str_to_date
+Warning 1411 Incorrect datetime value: '2003-01-02 10:11:12 PM' for function str_to_date
+Warning 1411 Incorrect datetime value: '10:20:10AM' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Septembei 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '15 Ju 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sund 15 MA' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Thursdai 12 1998' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Sunday 01 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: 'Tuesday 52 2001' for function str_to_date
+Warning 1411 Incorrect datetime value: '7 53 1998' for function str_to_date
truncate table t1;
insert into t1 values
('10:20:10AM', '%h:%i:%s'),
@@ -449,7 +449,7 @@ select str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'));
str_to_date('15-01-2001 12:59:59', GET_FORMAT(DATE,'USA'))
NULL
Warnings:
-Error 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date
+Warning 1411 Incorrect datetime value: '15-01-2001 12:59:59' for function str_to_date
explain extended select makedate(1997,1), addtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),subtime("31.12.97 11.59.59.999999 PM", "1 1.1.1.000002"),timediff("01.01.97 11:59:59.000001 PM","31.12.95 11:59:59.000002 PM"),cast(str_to_date("15-01-2001 12:59:59", "%d-%m-%Y %H:%i:%S") as TIME), maketime(23,11,12),microsecond("1997-12-31 23:59:59.000001");
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result
index fe24c17a1c5..66ef4df32eb 100644
--- a/mysql-test/r/ddl_i18n_koi8r.result
+++ b/mysql-test/r/ddl_i18n_koi8r.result
@@ -35,15 +35,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -87,15 +87,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -144,15 +144,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v1 select 'ÔÅÓÔ' AS `c1`,`mysqltest1`.`t1`.`ËÏÌ` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v2 select 'ÔÅÓÔ' AS `c1` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
+def mysqltest1 v3 select 'ÔÅÓÔ' AS `ÔÅÓÔ` NONE NO root@localhost DEFINER koi8r koi8r_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -362,7 +362,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -380,7 +380,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -398,7 +398,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -416,7 +416,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -608,7 +608,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -626,7 +626,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -644,7 +644,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -662,7 +662,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1010,7 +1010,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER koi8r koi8r_gen
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1028,7 +1028,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1046,7 +1046,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1064,7 +1064,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1323,7 +1323,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1338,7 +1338,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1353,7 +1353,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1368,7 +1368,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1596,7 +1596,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1611,7 +1611,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1626,7 +1626,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -1641,7 +1641,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2031,7 +2031,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2046,7 +2046,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2061,7 +2061,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci u
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2076,7 +2076,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost koi8r koi8r_general_ci
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(ÐÅÒÅÍ1));
INSERT INTO log VALUES(COLLATION('ÔÅËÓÔ'));
@@ -2226,7 +2226,7 @@ END|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2239,7 +2239,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2252,7 +2252,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2265,7 +2265,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2294,7 +2294,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2307,7 +2307,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2320,7 +2320,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2333,7 +2333,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2361,7 +2361,7 @@ set names koi8r|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2374,7 +2374,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2387,7 +2387,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2400,7 +2400,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2429,7 +2429,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2442,7 +2442,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2455,7 +2455,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2468,7 +2468,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2497,7 +2497,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2525,7 +2525,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2564,7 +2564,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2592,7 +2592,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2634,7 +2634,7 @@ set names koi8r|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2647,7 +2647,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2660,7 +2660,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2673,7 +2673,7 @@ END koi8r koi8r_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2702,7 +2702,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2715,7 +2715,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2728,7 +2728,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -2741,7 +2741,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result
index cf4272bf90c..f1f9592f5cf 100644
--- a/mysql-test/r/ddl_i18n_utf8.result
+++ b/mysql-test/r/ddl_i18n_utf8.result
@@ -35,15 +35,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кПл` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кПл` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -87,15 +87,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кПл` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кПл` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -144,15 +144,15 @@ v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v1'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кПл` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v1 select 'тест' AS `c1`,`mysqltest1`.`t1`.`кПл` AS `c2` from `mysqltest1`.`t1` NONE YES root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v2'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v2 select 'тест' AS `c1` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT * FROM INFORMATION_SCHEMA.VIEWS WHERE table_name = 'v3'|
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
+def mysqltest1 v3 select 'тест' AS `тест` NONE NO root@localhost DEFINER utf8 utf8_general_ci
SELECT COLLATION(c1), COLLATION(c2) FROM v1|
@@ -362,7 +362,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -380,7 +380,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -398,7 +398,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -416,7 +416,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -608,7 +608,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -626,7 +626,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -644,7 +644,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -662,7 +662,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -1010,7 +1010,7 @@ mysqltest2 p4 PROCEDURE root@localhost MODIFIED CREATED DEFINER utf8 utf8_gener
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p1'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p1 NULL mysqltest1 p1 PROCEDURE NULL SQL BEGIN
+p1 def mysqltest1 p1 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -1028,7 +1028,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p2'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p2 NULL mysqltest1 p2 PROCEDURE NULL SQL BEGIN
+p2 def mysqltest1 p2 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -1046,7 +1046,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p3'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p3 NULL mysqltest2 p3 PROCEDURE NULL SQL BEGIN
+p3 def mysqltest2 p3 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -1064,7 +1064,7 @@ END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost
SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_name = 'p4'|
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-p4 NULL mysqltest2 p4 PROCEDURE NULL SQL BEGIN
+p4 def mysqltest2 p4 PROCEDURE NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -1323,7 +1323,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -1338,7 +1338,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -1353,7 +1353,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -1368,7 +1368,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -1596,7 +1596,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -1611,7 +1611,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -1626,7 +1626,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -1641,7 +1641,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -2031,7 +2031,7 @@ use mysqltest1|
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg1'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg1 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg1 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -2046,7 +2046,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg2'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 trg2 INSERT NULL mysqltest1 t1 0 NULL BEGIN
+def mysqltest1 trg2 INSERT def mysqltest1 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -2061,7 +2061,7 @@ END ROW AFTER NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci utf
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg3'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg3 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg3 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10);
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -2076,7 +2076,7 @@ END ROW BEFORE NULL NULL OLD NEW CREATED root@localhost utf8 utf8_general_ci ut
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS WHERE trigger_name = 'trg4'|
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 trg4 INSERT NULL mysqltest2 t1 0 NULL BEGIN
+def mysqltest2 trg4 INSERT def mysqltest2 t1 0 NULL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
INSERT INTO log VALUES(COLLATION(переЌ1));
INSERT INTO log VALUES(COLLATION('текст'));
@@ -2226,7 +2226,7 @@ END|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -2239,7 +2239,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2252,7 +2252,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2265,7 +2265,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2294,7 +2294,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -2307,7 +2307,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2320,7 +2320,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2333,7 +2333,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2361,7 +2361,7 @@ set names utf8|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -2374,7 +2374,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2387,7 +2387,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2400,7 +2400,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2429,7 +2429,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -2442,7 +2442,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2455,7 +2455,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2468,7 +2468,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2497,7 +2497,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -2525,7 +2525,7 @@ ALTER DATABASE mysqltest1 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2564,7 +2564,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2592,7 +2592,7 @@ ALTER DATABASE mysqltest2 CHARACTER SET utf8 COLLATE utf8_unicode_ci ;;
/*!50003 SET sql_mode = '' */ ;;
/*!50003 SET @saved_time_zone = @@time_zone */ ;;
/*!50003 SET time_zone = 'SYSTEM' */ ;;
-/*!50106 CREATE EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+/*!50106 CREATE*/ /*!50117 DEFINER=`root`@`localhost`*/ /*!50106 EVENT `ev4` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2634,7 +2634,7 @@ set names utf8|
SHOW CREATE EVENT ev1|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -2647,7 +2647,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT ev2|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev2 SYSTEM CREATE EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev2 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev2` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2660,7 +2660,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2673,7 +2673,7 @@ END utf8 utf8_general_ci utf8_unicode_ci
SHOW CREATE EVENT mysqltest2.ev3|
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev3 SYSTEM CREATE EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
+ev3 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev3` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2702,7 +2702,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev1'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev1 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -2715,7 +2715,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev2'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
+def mysqltest1 ev2 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2728,7 +2728,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev3'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev3 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -2741,7 +2741,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
SELECT * FROM INFORMATION_SCHEMA.EVENTS WHERE event_name = 'ev4'|
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
+def mysqltest2 ev4 root@localhost SYSTEM SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
diff --git a/mysql-test/r/debug_sync.result b/mysql-test/r/debug_sync.result
index 47e968f79cf..8b46334204c 100644
--- a/mysql-test/r/debug_sync.result
+++ b/mysql-test/r/debug_sync.result
@@ -243,7 +243,7 @@ GRANT ALL ON *.* TO mysqltest_2@localhost;
REVOKE SUPER ON *.* FROM mysqltest_2@localhost;
connection con1, mysqltest_2
SET DEBUG_SYNC= 'RESET';
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
connection default
DROP USER mysqltest_2@localhost;
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index d8048a703a2..2bc77c52bec 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -252,7 +252,7 @@ HEX(a)
DROP TABLE t1;
CREATE TABLE t1 (a INT);
INSERT DELAYED INTO t1 SET b= b();
-ERROR 42S22: Unknown column 'b' in 'field list'
+ERROR 42000: FUNCTION test.b does not exist
DROP TABLE t1;
End of 5.0 tests
DROP TABLE IF EXISTS t1,t2;
@@ -323,3 +323,25 @@ Got one of the listed errors
UNLOCK TABLES;
DROP TABLE t1, t2;
End of 5.1 tests
+#
+# Bug #47274 assert in open_table on CREATE TABLE <already existing>
+#
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+CREATE TABLE t1 ( f1 INTEGER AUTO_INCREMENT, PRIMARY KEY (f1));
+# The following CREATE TABLEs before gave an assert.
+INSERT DELAYED t1 VALUES (4);
+CREATE TABLE t1 AS SELECT 1 AS f1;
+ERROR 42S01: Table 't1' already exists
+REPLACE DELAYED t1 VALUES (5);
+CREATE TABLE t1 AS SELECT 1 AS f1;
+ERROR 42S01: Table 't1' already exists
+INSERT DELAYED t1 VALUES (6);
+CREATE TABLE t1 (f1 INTEGER);
+ERROR 42S01: Table 't1' already exists
+CREATE TABLE t2 (f1 INTEGER);
+INSERT DELAYED t1 VALUES (7);
+CREATE TABLE t1 LIKE t2;
+ERROR 42S01: Table 't1' already exists
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/r/drop-no_root.result b/mysql-test/r/drop-no_root.result
new file mode 100644
index 00000000000..3e1f2fe2cf0
--- /dev/null
+++ b/mysql-test/r/drop-no_root.result
@@ -0,0 +1,28 @@
+
+# --
+# -- Bug#26704: Failing DROP DATABASE brings mysql-client out of sync.
+# --
+
+DROP DATABASE IF EXISTS mysql_test;
+
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(c INT);
+use mysql_test;
+
+chmod 000 mysql_test/t1.frm
+
+DROP DATABASE mysql_test;
+
+SELECT DATABASE();
+DATABASE()
+mysql_test
+
+rm -f mysql_test/t1.MYD mysql_test/t1.MYI
+chmod 666 mysql_test/t1.frm
+rm -f mysql_test/t1.frm
+
+DROP DATABASE mysql_test;
+
+use test;
+
+# -- End of Bug#26704.
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index b798b49dd34..42739b10d50 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -121,3 +121,17 @@ ERROR 42000: Incorrect table name '#mysql50#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
use test;
drop database mysqltestbug26703;
End of 5.1 tests
+
+# --
+# -- Bug#37431 (DROP TABLE does not report errors correctly).
+# --
+DROP TABLE IF EXISTS t1;
+DROP TABLE t1;
+ERROR 42S02: Unknown table 't1'
+SHOW WARNINGS;
+Level Code Message
+Error 1051 Unknown table 't1'
+
+# --
+# -- End of Bug#37431.
+# --
diff --git a/mysql-test/r/drop_debug.result b/mysql-test/r/drop_debug.result
new file mode 100644
index 00000000000..75346b88bc6
--- /dev/null
+++ b/mysql-test/r/drop_debug.result
@@ -0,0 +1,21 @@
+
+# --
+# -- Bug#43138: DROP DATABASE failure does not clean up message list.
+# --
+
+DROP DATABASE IF EXISTS mysql_test;
+
+CREATE DATABASE mysql_test;
+CREATE TABLE mysql_test.t1(a INT);
+
+SET SESSION DEBUG = "+d,bug43138";
+
+DROP DATABASE mysql_test;
+Warnings:
+Error 1051 Unknown table 't1'
+
+SET SESSION DEBUG = "-d,bug43138";
+
+# --
+# -- End of Bug#43138.
+# --
diff --git a/mysql-test/r/errors.result b/mysql-test/r/errors.result
index 022a32d9c9b..d15daf2e4b0 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -55,3 +55,32 @@ Error 1054 Unknown column 'b' in 'field list'
INSERT INTO t1 SELECT b FROM t1;
ERROR 42S22: Unknown column 'b' in 'field list'
DROP TABLE t1;
+SET NAMES utf8;
+SET sql_quote_show_create= _binary x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create=_latin1 x'5452DC45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create='TRÜE';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create=TRÜE;
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET NAMES latin1;
+SET sql_quote_show_create= _binary x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create=_latin1 x'5452DC45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create='TR.E';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR.E'
+SET sql_quote_show_create=TR.E;
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'E'
+SET NAMES binary;
+SET sql_quote_show_create= _binary x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TR\xC3\x9CE'
+SET sql_quote_show_create= _utf8 x'5452C39C45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
+SET sql_quote_show_create=_latin1 x'5452DC45';
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'TRÜE'
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index e7b645f5556..e068158e6ce 100644
--- a/mysql-test/r/events_1.result
+++ b/mysql-test/r/events_1.result
@@ -123,80 +123,80 @@ set names utf8;
CREATE EVENT root6 ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1;
SHOW CREATE EVENT root6;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root6 SYSTEM CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root6 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND STARTS '#' ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root7 on schedule every 2 year do select 1;
SHOW CREATE EVENT root7;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root7 SYSTEM CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root7 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root7` ON SCHEDULE EVERY 2 YEAR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root8 on schedule every '2:5' year_month do select 1;
SHOW CREATE EVENT root8;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root8 SYSTEM CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root8 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root8_1 on schedule every '2:15' year_month do select 1;
SHOW CREATE EVENT root8_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root8_1 SYSTEM CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root8_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root9 on schedule every 2 week ON COMPLETION PRESERVE DISABLE COMMENT 'кПЌеМтар Ма кОрОлОца' do select 1;
SHOW CREATE EVENT root9;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root9 SYSTEM CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'кПЌеМтар Ма кОрОлОца' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root9 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root9` ON SCHEDULE EVERY 2 WEEK STARTS '#' ON COMPLETION PRESERVE DISABLE COMMENT 'кПЌеМтар Ма кОрОлОца' DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root10 on schedule every '20:5' day_hour do select 1;
SHOW CREATE EVENT root10;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root10 SYSTEM CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root10 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root11 on schedule every '20:25' day_hour do select 1;
SHOW CREATE EVENT root11;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root11 SYSTEM CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root11 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root12 on schedule every '20:25' hour_minute do select 1;
SHOW CREATE EVENT root12;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root12 SYSTEM CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root12 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root13 on schedule every '25:25' hour_minute do select 1;
SHOW CREATE EVENT root13;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root13 SYSTEM CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root13 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root13_1 on schedule every '11:65' hour_minute do select 1;
SHOW CREATE EVENT root13_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root13_1 SYSTEM CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root13_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root14 on schedule every '35:35' minute_second do select 1;
SHOW CREATE EVENT root14;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root14 SYSTEM CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root14 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root15 on schedule every '35:66' minute_second do select 1;
SHOW CREATE EVENT root15;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root15 SYSTEM CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root15 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root16 on schedule every '35:56' day_minute do select 1;
SHOW CREATE EVENT root16;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root16 SYSTEM CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root16 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root17 on schedule every '35:12:45' day_minute do select 1;
SHOW CREATE EVENT root17;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root17 SYSTEM CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root17 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root17_1 on schedule every '35:25:65' day_minute do select 1;
SHOW CREATE EVENT root17_1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root17_1 SYSTEM CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root17_1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root18 on schedule every '35:12:45' hour_second do select 1;
SHOW CREATE EVENT root18;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root18 SYSTEM CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root18 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root19 on schedule every '15:59:85' hour_second do select 1;
SHOW CREATE EVENT root19;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root19 SYSTEM CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root19 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
create event root20 on schedule every '50:20:12:45' day_second do select 1;
SHOW CREATE EVENT root20;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-root20 SYSTEM CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+root20 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
set names cp1251;
create event ðóóò21 on schedule every '50:23:59:95' day_second COMMENT 'òîâà å 1251 êîìåíòàð' do select 1;
SHOW CREATE EVENT ðóóò21;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ðóóò21 SYSTEM CREATE EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'тПва е 1251 кПЌеМтар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci
+ðóóò21 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `руут21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND STARTS '#' ON COMPLETION NOT PRESERVE ENABLE COMMENT 'тПва е 1251 кПЌеМтар' DO select 1 cp1251 cp1251_general_ci latin1_swedish_ci
insert into mysql.event (
db,
name,
@@ -271,7 +271,7 @@ event_name
intact_check
SHOW CREATE EVENT intact_check;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-intact_check SYSTEM CREATE EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
+intact_check SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `intact_check` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO SELECT "nothing" latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT no_such_event;
ERROR HY000: Unknown event 'no_such_event'
CREATE EVENT intact_check_1 ON SCHEDULE EVERY 5 HOUR DO SELECT 5;
diff --git a/mysql-test/r/events_2.result b/mysql-test/r/events_2.result
index db503f7aa6d..44eaa668b04 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -134,7 +134,7 @@ create event e1 on schedule every 10 hour do select 1;
lock table t1 read;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -152,7 +152,7 @@ unlock tables;
lock table t1 write;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -170,7 +170,7 @@ unlock tables;
lock table t1 read, mysql.event read;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -188,7 +188,7 @@ unlock tables;
lock table t1 write, mysql.event read;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
@@ -210,7 +210,7 @@ ERROR HY000: You can't combine write-locking of system tables with other tables
lock table mysql.event write;
show create event e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 SYSTEM CREATE EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
+e1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 10 HOUR STARTS '#' ON COMPLETION NOT PRESERVE ENABLE DO select 1 utf8 utf8_general_ci latin1_swedish_ci
select event_name from information_schema.events;
event_name
e1
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index 50bfa97c59f..efe6df41ac6 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -16,7 +16,7 @@ DROP EVENT Lower_case;
SET NAMES cp1251;
CREATE EVENT äîëåí_ðåãèñòúð_1251 ON SCHEDULE EVERY 1 YEAR DO SELECT 100;
CREATE EVENT ÄîËåÍ_ðåãèñòúð_1251 ON SCHEDULE EVERY 2 YEAR DO SELECT 200;
-ERROR HY000: Event 'ДПЛеН_регОстър_1251' already exists
+ERROR HY000: Event 'ÄîËåÍ_ðåãèñòúð_1251' already exists
DROP EVENT ÄîËåÍ_ðåãèñòúð_1251;
SET NAMES utf8;
CREATE EVENT ЎПлеМ_регОстър_утф8 ON SCHEDULE EVERY 3 YEAR DO SELECT 300;
@@ -77,7 +77,7 @@ set sql_mode='traditional';
alter event e_16407 do select 1;
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test e_16407 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test e_16407 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
drop event e_16407;
set sql_mode="ansi";
select get_lock('ee_16407_2', 60);
@@ -114,8 +114,8 @@ insert into events_test.events_smode_test values ('ee_16407_4','10-11-1956');
end|
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
events_test ee_16407_4
select /*2*/ user, host, db, info from information_schema.processlist
where state = 'User lock' and info = 'select get_lock(\'ee_16407_2\', 60)';
@@ -138,8 +138,8 @@ ee_16407_4 0000-00-00
"OK, last check before we drop them"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test ee_16407_2 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+events_test ee_16407_3 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
events_test ee_16407_4
drop event ee_16407_2;
drop event ee_16407_3;
@@ -185,8 +185,8 @@ ee_16407_6 2004-02-29
"And here we check one more time before we drop the events"
select event_schema, event_name, sql_mode from information_schema.events order by event_schema, event_name;
event_schema event_name sql_mode
-events_test ee_16407_5 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
-events_test ee_16407_6 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER
+events_test ee_16407_5 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
+events_test ee_16407_6 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
drop event ee_16407_5;
drop event ee_16407_6;
drop procedure ee_16407_5_pendant;
@@ -375,7 +375,7 @@ SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
ALTER DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 HOUR;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
@@ -386,7 +386,7 @@ event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
CREATE DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
DROP EVENT e1;
ERROR HY000: Unknown event 'e1'
DROP USER mysqltest_u1@localhost;
@@ -434,9 +434,9 @@ CREATE EVENT e3 ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' DO
SELECT 1;
SELECT * FROM INFORMATION_SCHEMA.EVENTS ORDER BY event_name;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER TIME_ZONE EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD SQL_MODE STARTS ENDS STATUS ON_COMPLETION CREATED LAST_ALTERED LAST_EXECUTED EVENT_COMMENT ORIGINATOR CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
-NULL events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
-NULL events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e1 root@localhost +05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:58:59 2005-12-31 23:58:59 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e2 root@localhost -05:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:00 2005-12-31 23:59:00 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
+def events_test e3 root@localhost +00:00 SQL SELECT 1 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED NOT PRESERVE 2005-12-31 23:59:01 2005-12-31 23:59:01 NULL 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
events_test e1 root@localhost +05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
@@ -444,13 +444,13 @@ events_test e2 root@localhost -05:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NU
events_test e3 root@localhost +00:00 RECURRING NULL 1 DAY 2006-01-01 00:00:00 NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e1 +05:00 CREATE EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e1 +05:00 CREATE DEFINER=`root`@`localhost` EVENT `e1` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e2;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e2 -05:00 CREATE EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e2 -05:00 CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT e3;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-e3 +00:00 CREATE EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
+e3 +00:00 CREATE DEFINER=`root`@`localhost` EVENT `e3` ON SCHEDULE EVERY 1 DAY STARTS '2006-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
The following should fail, and nothing should be altered.
ALTER EVENT e1 ON SCHEDULE EVERY 1 HOUR STARTS '1999-01-01 00:00:00'
ENDS '1999-01-02 00:00:00';
diff --git a/mysql-test/r/events_grant.result b/mysql-test/r/events_grant.result
index 1aadf7e11f4..0fb589dfba5 100644
--- a/mysql-test/r/events_grant.result
+++ b/mysql-test/r/events_grant.result
@@ -6,7 +6,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
events_test one_event root@localhost SYSTEM RECURRING NULL 10 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
CREATE DATABASE events_test2;
CREATE USER ev_test@localhost;
GRANT ALL ON events_test.* to ev_test@localhost;
@@ -59,53 +59,53 @@ USE events_test;
"We should see 4 events : one_event, two_event, three_event & four_event"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
-NULL events_test2 four_event ev_test@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test2 four_event ev_test@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
DROP DATABASE events_test2;
"We should see 3 events : one_event, two_event, three_event"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
CREATE DATABASE events_test2;
USE events_test2;
CREATE EVENT five_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
"Should see 4 events - one, two, three & five"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
-NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
USE test;
"Should see 3 events - one, two & three"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
"Let's test ALTER EVENT which changes the definer"
USE events_test;
ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
"The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+def events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
USE events_test;
ALTER EVENT one_event COMMENT "comment";
"The definer should be root@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
+def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
ALTER EVENT one_event DO SELECT 12;
"The definer should be ev_test@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
+def events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
"make the definer again root@localhost"
ALTER EVENT one_event COMMENT "new comment";
"test DROP by another user"
@@ -113,9 +113,9 @@ DROP EVENT one_event;
"One event should not be there"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
-NULL events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
-NULL events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
-NULL events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
+def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
DROP USER ev_test@localhost;
DROP DATABASE events_test2;
DROP DATABASE events_test;
diff --git a/mysql-test/r/explain.result b/mysql-test/r/explain.result
index 5a1bf1a1290..3c449cf11a1 100644
--- a/mysql-test/r/explain.result
+++ b/mysql-test/r/explain.result
@@ -64,7 +64,7 @@ explain extended select * from v1 where f2=1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
+Note 1003 select '1' AS `f1`,'1' AS `f2` from dual where 1
explain extended select * from t1 where 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
@@ -74,7 +74,7 @@ explain extended select * from t1 where 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` where 1
+Note 1003 select '1' AS `f1`,'1' AS `f2` from dual where 1
explain extended select * from t1 having 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible HAVING
@@ -84,7 +84,7 @@ explain extended select * from t1 having 1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `f1`,'1' AS `f2` from `test`.`t1` having 1
+Note 1003 select '1' AS `f1`,'1' AS `f2` from dual having 1
drop view v1;
drop table t1;
CREATE TABLE t1(c INT);
@@ -210,4 +210,24 @@ Error 1140 Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP colum
Note 1003 select 1 AS `1` from `test`.`t1` where <not>(<exists>(...))
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1;
+#
+# Bug#30302: Tables that were optimized away are printed in the
+# EXPLAIN EXTENDED warning.
+#
+create table t1(f1 int);
+create table t2(f2 int);
+insert into t1 values(1);
+insert into t2 values(1),(2);
+explain extended select * from t1 where f1=1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+Warnings:
+Note 1003 select '1' AS `f1` from dual where 1
+explain extended select * from t1 join t2 on f1=f2 where f1=1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select '1' AS `f1`,`test`.`t2`.`f2` AS `f2` from `test`.`t2` where (`test`.`t2`.`f2` = 1)
+drop table t1,t2;
End of 5.1 tests.
diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result
index c7fd7a11877..4348dbd67e5 100644
--- a/mysql-test/r/flush_block_commit_notembedded.result
+++ b/mysql-test/r/flush_block_commit_notembedded.result
@@ -9,13 +9,13 @@ INSERT t1 VALUES (1);
FLUSH TABLES WITH READ LOCK;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106
+master-bin.000001 107
# Switch to connection con1
COMMIT;
# Switch to connection con2
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 106
+master-bin.000001 107
UNLOCK TABLES;
# Switch to connection con1
DROP TABLE t1;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 6022231907b..df3fc7e050c 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -494,6 +494,14 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
a
City Of God
DROP TABLE t1;
+create table t1(a text,b date,fulltext index(a))engine=myisam;
+insert into t1 set a='water',b='2008-08-04';
+select 1 from t1 where match(a) against ('water' in boolean mode) and b>='2008-08-01';
+1
+1
+drop table t1;
+show warnings;
+Level Code Message
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
('test', 1),('test', 2),('test', 3),('test', 4);
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index b4e61d0e4fc..650cc9c2c70 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -65,8 +65,8 @@ NULL
50000
NULL
Warnings:
-Error 1259 ZLIB: Input data corrupted
-Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
+Warning 1259 ZLIB: Input data corrupted
+Warning 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
drop table t1;
set @@global.max_allowed_packet=1048576*100;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
@@ -96,12 +96,12 @@ 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
+Warning 1259 ZLIB: Input data corrupted
select * from t1 where uncompress(a) is null;
a
foo
Warnings:
-Error 1259 ZLIB: Input data corrupted
+Warning 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
@@ -109,13 +109,13 @@ select *, uncompress(a) from t1;
a uncompress(a)
foo NULL
Warnings:
-Error 1259 ZLIB: Input data corrupted
+Warning 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
+Warning 1259 ZLIB: Input data corrupted
+Warning 1259 ZLIB: Input data corrupted
drop table t1;
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1), (1111), (11111);
diff --git a/mysql-test/r/func_default.result b/mysql-test/r/func_default.result
index a8f59f73e88..68a3a58e63f 100644
--- a/mysql-test/r/func_default.result
+++ b/mysql-test/r/func_default.result
@@ -8,7 +8,7 @@ explain extended select default(str), default(strnull), default(intg), default(r
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from `test`.`t1`
+Note 1003 select default('') AS `default(str)`,default('') AS `default(strnull)`,default('0') AS `default(intg)`,default('0') AS `default(rel)` from dual
select * from t1 where str <> default(str);
str strnull intg rel
0 0
diff --git a/mysql-test/r/func_encrypt.result b/mysql-test/r/func_encrypt.result
index 8fbf36b45b9..91ff4e218fb 100644
--- a/mysql-test/r/func_encrypt.result
+++ b/mysql-test/r/func_encrypt.result
@@ -124,7 +124,7 @@ select des_encrypt("hello",10);
des_encrypt("hello",10)
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_encrypt'
+Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt(NULL);
des_encrypt(NULL)
NULL
@@ -138,12 +138,12 @@ select des_encrypt(10, NULL);
des_encrypt(10, NULL)
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_encrypt'
+Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_encrypt("hello", NULL);
des_encrypt("hello", NULL)
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_encrypt'
+Warning 1108 Incorrect parameters to procedure 'des_encrypt'
select des_decrypt("hello",10);
des_decrypt("hello",10)
hello
@@ -177,7 +177,7 @@ select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
-Error 1108 Incorrect parameters to procedure 'des_decrypt'
+Warning 1108 Incorrect parameters to procedure 'des_decrypt'
explain extended select des_decrypt(des_encrypt("hello",4),'password2'), des_decrypt(des_encrypt("hello","hidden"));
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
diff --git a/mysql-test/r/func_encrypt_nossl.result b/mysql-test/r/func_encrypt_nossl.result
index d0df2335afa..fc003eec226 100644
--- a/mysql-test/r/func_encrypt_nossl.result
+++ b/mysql-test/r/func_encrypt_nossl.result
@@ -2,83 +2,83 @@ select des_encrypt("test", 'akeystr');
des_encrypt("test", 'akeystr')
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 1);
des_encrypt("test", 1)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 9);
des_encrypt("test", 9)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", 100);
des_encrypt("test", 100)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt("test", NULL);
des_encrypt("test", NULL)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_encrypt(NULL, NULL);
des_encrypt(NULL, NULL)
NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt("test", 'anotherkeystr');
des_decrypt("test", 'anotherkeystr')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(1, 1);
des_decrypt(1, 1)
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("test", 'thekey'));
des_decrypt(des_encrypt("test", 'thekey'))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),des_decrypt(des_encrypt("hello"));
hex(des_encrypt("hello")) des_decrypt(des_encrypt("hello"))
NULL NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4));
des_decrypt(des_encrypt("hello",4))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",'test'),'test');
des_decrypt(des_encrypt("hello",'test'),'test')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_encrypt("hello")),hex(des_encrypt("hello",5)),hex(des_encrypt("hello",'default_password'));
hex(des_encrypt("hello")) hex(des_encrypt("hello",5)) hex(des_encrypt("hello",'default_password'))
NULL NULL NULL
Warnings:
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
-Error 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_encrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello"),'default_password');
des_decrypt(des_encrypt("hello"),'default_password')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select des_decrypt(des_encrypt("hello",4),'password4');
des_decrypt(des_encrypt("hello",4),'password4')
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
SET @a=des_decrypt(des_encrypt("hello"));
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
flush des_key_file;
select @a = des_decrypt(des_encrypt("hello"));
@a = des_decrypt(des_encrypt("hello"))
@@ -90,9 +90,9 @@ select hex(des_decrypt(des_encrypt("hello",4),'password2'));
hex(des_decrypt(des_encrypt("hello",4),'password2'))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
select hex(des_decrypt(des_encrypt("hello","hidden")));
hex(des_decrypt(des_encrypt("hello","hidden")))
NULL
Warnings:
-Error 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
+Warning 1289 The 'des_decrypt' feature is disabled; you need MySQL built with '--with-openssl' to have it working
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 3b78851a1b9..ebec186591d 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -153,10 +153,10 @@ grp group_concat(c)
4
5 NULL
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
show warnings;
Level Code Message
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
set group_concat_max_len = 1024;
select group_concat(sum(c)) from t1 group by grp;
ERROR HY000: Invalid use of group function
@@ -380,25 +380,29 @@ group_concat(b)
bb,c
BB,C
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,c
BB,C
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
a,bb
A,BB
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+Warning 1260 Row 6 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
a,bb
A,BB
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+Warning 1260 Row 6 was cut by GROUP_CONCAT()
insert into t1 values (1, concat(repeat('1', 300), '2')),
(1, concat(repeat('1', 300), '2')), (1, concat(repeat('0', 300), '1')),
(2, concat(repeat('1', 300), '2')), (2, concat(repeat('1', 300), '2')),
@@ -426,25 +430,29 @@ group_concat(b)
bb,ccc,a,bb,ccc,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
BB,CCC,A,BB,CCC,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,1111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 7 was cut by GROUP_CONCAT()
+Warning 1260 Row 14 was cut by GROUP_CONCAT()
select group_concat(distinct b) from t1 group by a;
group_concat(distinct b)
bb,ccc,a,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
BB,CCC,A,1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112,00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 5 was cut by GROUP_CONCAT()
+Warning 1260 Row 10 was cut by GROUP_CONCAT()
select group_concat(b order by b) from t1 group by a;
group_concat(b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
select group_concat(distinct b order by b) from t1 group by a;
group_concat(distinct b order by b)
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001,11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 4 was cut by GROUP_CONCAT()
drop table t1;
create table t1 (a varchar(255) character set cp1250 collate cp1250_general_ci,
b varchar(255) character set koi8r);
@@ -751,22 +759,22 @@ SELECT GROUP_CONCAT( a ) FROM t1;
GROUP_CONCAT( a )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( DISTINCT a ) FROM t1;
GROUP_CONCAT( DISTINCT a )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( a ORDER BY b ) FROM t1;
GROUP_CONCAT( a ORDER BY b )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SELECT GROUP_CONCAT( DISTINCT a ORDER BY b ) FROM t1;
GROUP_CONCAT( DISTINCT a ORDER BY b )
aaaaaaaaaa,bbbbbbbbb
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
SET group_concat_max_len = DEFAULT;
DROP TABLE t1;
SET group_concat_max_len= 65535;
@@ -979,3 +987,31 @@ GROUP BY t1.a
1
DROP TABLE t1, t2;
End of 5.0 tests
+DROP TABLE IF EXISTS t1, t2;
+CREATE TABLE t1 (a VARCHAR(6), b INT);
+CREATE TABLE t2 (a VARCHAR(6), b INT);
+INSERT INTO t1 VALUES ('111111', 1);
+INSERT INTO t1 VALUES ('222222', 2);
+INSERT INTO t1 VALUES ('333333', 3);
+INSERT INTO t1 VALUES ('444444', 4);
+INSERT INTO t1 VALUES ('555555', 5);
+SET group_concat_max_len = 5;
+SET @old_sql_mode = @@sql_mode, @@sql_mode = 'traditional';
+SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b LIMIT 3;
+GROUP_CONCAT(a) b
+11111 1
+22222 2
+33333 3
+Warnings:
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
+Warning 1260 Row 3 was cut by GROUP_CONCAT()
+INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
+ERROR HY000: Row 1 was cut by GROUP_CONCAT()
+UPDATE t1 SET a = '11111' WHERE b = 1;
+UPDATE t1 SET a = '22222' WHERE b = 2;
+INSERT INTO t2 SELECT GROUP_CONCAT(a), b FROM t1 GROUP BY b;
+ERROR HY000: Row 3 was cut by GROUP_CONCAT()
+SET group_concat_max_len = DEFAULT;
+SET @@sql_mode = @old_sql_mode;
+DROP TABLE t1, t2;
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index fd7ef72409e..33ae2e0a5a4 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -225,27 +225,27 @@ select ln(-1);
ln(-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log10(-1);
log10(-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log2(-1);
log2(-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log(2,-1);
log(2,-1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select log(-2,1);
log(-2,1)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
set sql_mode='';
select round(111,-10);
round(111,-10)
@@ -382,6 +382,9 @@ y
SELECT b DIV 900 y FROM t1 GROUP BY y;
y
0
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: 'str1'
+Warning 1292 Truncated incorrect INTEGER value: 'str2'
SELECT c DIV 900 y FROM t1 GROUP BY y;
y
0
diff --git a/mysql-test/r/func_regexp.result b/mysql-test/r/func_regexp.result
index 54aad23402f..43f90e2e2e6 100644
--- a/mysql-test/r/func_regexp.result
+++ b/mysql-test/r/func_regexp.result
@@ -52,7 +52,7 @@ explain extended select * from t1 where xxx regexp('is a test of some long text
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from `test`.`t1` where ('this is a test of some long text to see what happens' regexp 'is a test of some long text to')
+Note 1003 select 'this is a test of some long text to see what happens' AS `xxx` from dual where ('this is a test of some long text to see what happens' regexp 'is a test of some long text to')
select * from t1 where xxx regexp('is a test of some long text to ');
xxx
this is a test of some long text to see what happens
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index bbc5390895b..87b88692a34 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -194,7 +194,7 @@ date("1997-12-31 23:59:59.000001") as f8,
time("1997-12-31 23:59:59.000001") as f9;
describe t1;
Field Type Null Key Default Extra
-f1 date NO 0000-00-00
+f1 date YES NULL
f2 datetime YES NULL
f3 time YES NULL
f4 time YES NULL
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index 2a2fe50ad0f..35ce190feb3 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1151,6 +1151,9 @@ INSERT INTO t2 VALUES (0), (1);
SELECT * FROM t1, t2 WHERE num=str;
str num
notnumber 0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'notnumber'
+Warning 1292 Truncated incorrect DOUBLE value: 'notnumber'
SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
str num
notnumber 0
@@ -1433,7 +1436,7 @@ select benchmark(-1, 1);
benchmark(-1, 1)
NULL
Warnings:
-Error 1411 Incorrect count value: '-1' for function benchmark
+Warning 1411 Incorrect count value: '-1' for function benchmark
set @password="password";
set @my_data="clear text to encode";
select md5(encode(@my_data, "password"));
@@ -1533,7 +1536,7 @@ select locate('lo','hello',-18446744073709551615);
locate('lo','hello',-18446744073709551615)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551615);
locate('lo','hello',18446744073709551615)
0
@@ -1541,22 +1544,22 @@ select locate('lo','hello',-18446744073709551616);
locate('lo','hello',-18446744073709551616)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551616);
locate('lo','hello',18446744073709551616)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',-18446744073709551617);
locate('lo','hello',-18446744073709551617)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select locate('lo','hello',18446744073709551617);
locate('lo','hello',18446744073709551617)
0
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 10);
left('hello', 10)
hello
@@ -1588,8 +1591,8 @@ select left('hello', -18446744073709551615);
left('hello', -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551615);
left('hello', 18446744073709551615)
hello
@@ -1597,26 +1600,26 @@ select left('hello', -18446744073709551616);
left('hello', -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551616);
left('hello', 18446744073709551616)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', -18446744073709551617);
left('hello', -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select left('hello', 18446744073709551617);
left('hello', 18446744073709551617)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 10);
right('hello', 10)
hello
@@ -1648,8 +1651,8 @@ select right('hello', -18446744073709551615);
right('hello', -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551615);
right('hello', 18446744073709551615)
hello
@@ -1657,26 +1660,26 @@ select right('hello', -18446744073709551616);
right('hello', -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551616);
right('hello', 18446744073709551616)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', -18446744073709551617);
right('hello', -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select right('hello', 18446744073709551617);
right('hello', 18446744073709551617)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 2, -1);
substring('hello', 2, -1)
@@ -1708,8 +1711,8 @@ select substring('hello', -18446744073709551615, 1);
substring('hello', -18446744073709551615, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551615, 1);
substring('hello', 18446744073709551615, 1)
@@ -1717,26 +1720,26 @@ select substring('hello', -18446744073709551616, 1);
substring('hello', -18446744073709551616, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551616, 1);
substring('hello', 18446744073709551616, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -18446744073709551617, 1);
substring('hello', -18446744073709551617, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551617, 1);
substring('hello', 18446744073709551617, 1)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, -1);
substring('hello', 1, -1)
@@ -1762,8 +1765,8 @@ select substring('hello', 1, -18446744073709551615);
substring('hello', 1, -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551615);
substring('hello', 1, 18446744073709551615)
hello
@@ -1771,26 +1774,26 @@ select substring('hello', 1, -18446744073709551616);
substring('hello', 1, -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551616);
substring('hello', 1, 18446744073709551616)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, -18446744073709551617);
substring('hello', 1, -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 1, 18446744073709551617);
substring('hello', 1, 18446744073709551617)
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -1, -1);
substring('hello', -1, -1)
@@ -1816,10 +1819,10 @@ select substring('hello', -18446744073709551615, -18446744073709551615);
substring('hello', -18446744073709551615, -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551615, 18446744073709551615);
substring('hello', 18446744073709551615, 18446744073709551615)
@@ -1827,34 +1830,34 @@ select substring('hello', -18446744073709551616, -18446744073709551616);
substring('hello', -18446744073709551616, -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551616, 18446744073709551616);
substring('hello', 18446744073709551616, 18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', -18446744073709551617, -18446744073709551617);
substring('hello', -18446744073709551617, -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select substring('hello', 18446744073709551617, 18446744073709551617);
substring('hello', 18446744073709551617, 18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -1, 1, 'hi');
insert('hello', -1, 1, 'hi')
hello
@@ -1880,7 +1883,7 @@ select insert('hello', -18446744073709551615, 1, 'hi');
insert('hello', -18446744073709551615, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551615, 1, 'hi');
insert('hello', 18446744073709551615, 1, 'hi')
hello
@@ -1888,22 +1891,22 @@ select insert('hello', -18446744073709551616, 1, 'hi');
insert('hello', -18446744073709551616, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551616, 1, 'hi');
insert('hello', 18446744073709551616, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -18446744073709551617, 1, 'hi');
insert('hello', -18446744073709551617, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551617, 1, 'hi');
insert('hello', 18446744073709551617, 1, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, -1, 'hi');
insert('hello', 1, -1, 'hi')
hi
@@ -1929,7 +1932,7 @@ select insert('hello', 1, -18446744073709551615, 'hi');
insert('hello', 1, -18446744073709551615, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551615, 'hi');
insert('hello', 1, 18446744073709551615, 'hi')
hi
@@ -1937,22 +1940,22 @@ select insert('hello', 1, -18446744073709551616, 'hi');
insert('hello', 1, -18446744073709551616, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551616, 'hi');
insert('hello', 1, 18446744073709551616, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, -18446744073709551617, 'hi');
insert('hello', 1, -18446744073709551617, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 1, 18446744073709551617, 'hi');
insert('hello', 1, 18446744073709551617, 'hi')
hi
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -1, -1, 'hi');
insert('hello', -1, -1, 'hi')
hello
@@ -1978,8 +1981,8 @@ select insert('hello', -18446744073709551615, -18446744073709551615, 'hi');
insert('hello', -18446744073709551615, -18446744073709551615, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551615, 18446744073709551615, 'hi');
insert('hello', 18446744073709551615, 18446744073709551615, 'hi')
hello
@@ -1987,26 +1990,26 @@ select insert('hello', -18446744073709551616, -18446744073709551616, 'hi');
insert('hello', -18446744073709551616, -18446744073709551616, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551616, 18446744073709551616, 'hi');
insert('hello', 18446744073709551616, 18446744073709551616, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', -18446744073709551617, -18446744073709551617, 'hi');
insert('hello', -18446744073709551617, -18446744073709551617, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select insert('hello', 18446744073709551617, 18446744073709551617, 'hi');
insert('hello', 18446744073709551617, 18446744073709551617, 'hi')
hello
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', -1);
repeat('hello', -1)
@@ -2038,8 +2041,8 @@ select repeat('hello', -18446744073709551615);
repeat('hello', -18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551615);
repeat('hello', 18446744073709551615)
NULL
@@ -2049,27 +2052,27 @@ select repeat('hello', -18446744073709551616);
repeat('hello', -18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551616);
repeat('hello', 18446744073709551616)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select repeat('hello', -18446744073709551617);
repeat('hello', -18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select repeat('hello', 18446744073709551617);
repeat('hello', 18446744073709551617)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select space(-1);
space(-1)
@@ -2102,8 +2105,8 @@ select space(-18446744073709551615);
space(-18446744073709551615)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551615);
space(18446744073709551615)
NULL
@@ -2113,27 +2116,27 @@ select space(-18446744073709551616);
space(-18446744073709551616)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551616);
space(18446744073709551616)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select space(-18446744073709551617);
space(-18446744073709551617)
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select space(18446744073709551617);
space(18446744073709551617)
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of repeat() was larger than max_allowed_packet (1048576) - truncated
select rpad('hello', -1, '1');
rpad('hello', -1, '1')
@@ -2166,8 +2169,8 @@ select rpad('hello', -18446744073709551615, '1');
rpad('hello', -18446744073709551615, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551615, '1');
rpad('hello', 18446744073709551615, '1')
NULL
@@ -2177,27 +2180,27 @@ select rpad('hello', -18446744073709551616, '1');
rpad('hello', -18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551616, '1');
rpad('hello', 18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated
select rpad('hello', -18446744073709551617, '1');
rpad('hello', -18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select rpad('hello', 18446744073709551617, '1');
rpad('hello', 18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of rpad() was larger than max_allowed_packet (1048576) - truncated
select lpad('hello', -1, '1');
lpad('hello', -1, '1')
@@ -2230,8 +2233,8 @@ select lpad('hello', -18446744073709551615, '1');
lpad('hello', -18446744073709551615, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551615, '1');
lpad('hello', 18446744073709551615, '1')
NULL
@@ -2241,27 +2244,27 @@ select lpad('hello', -18446744073709551616, '1');
lpad('hello', -18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551616, '1');
lpad('hello', 18446744073709551616, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated
select lpad('hello', -18446744073709551617, '1');
lpad('hello', -18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select lpad('hello', 18446744073709551617, '1');
lpad('hello', 18446744073709551617, '1')
NULL
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1301 Result of lpad() was larger than max_allowed_packet (1048576) - truncated
SET @orig_sql_mode = @@SQL_MODE;
SET SQL_MODE=traditional;
@@ -2269,12 +2272,12 @@ SELECT CHAR(0xff,0x8f USING utf8);
CHAR(0xff,0x8f USING utf8)
NULL
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
SELECT CHAR(0xff,0x8f USING utf8) IS NULL;
CHAR(0xff,0x8f USING utf8) IS NULL
1
Warnings:
-Error 1300 Invalid utf8 character string: 'FF8F'
+Warning 1300 Invalid utf8 character string: 'FF8F'
SET SQL_MODE=@orig_sql_mode;
select substring('abc', cast(2 as unsigned int));
substring('abc', cast(2 as unsigned int))
@@ -2558,3 +2561,133 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using join buffer
2 DERIVED t1 ALL NULL NULL NULL NULL 2
drop table t1;
+Start of 5.4 tests
+SELECT format(12345678901234567890.123, 3);
+format(12345678901234567890.123, 3)
+12,345,678,901,234,567,890.123
+SELECT format(12345678901234567890.123, 3, NULL);
+format(12345678901234567890.123, 3, NULL)
+12,345,678,901,234,567,890.123
+Warnings:
+Warning 1649 Unknown locale: 'NULL'
+SELECT format(12345678901234567890.123, 3, 'ar_AE');
+format(12345678901234567890.123, 3, 'ar_AE')
+12,345,678,901,234,567,890.123
+SELECT format(12345678901234567890.123, 3, 'ar_SA');
+format(12345678901234567890.123, 3, 'ar_SA')
+12345678901234567890.123
+SELECT format(12345678901234567890.123, 3, 'be_BY');
+format(12345678901234567890.123, 3, 'be_BY')
+12.345.678.901.234.567.890,123
+SELECT format(12345678901234567890.123, 3, 'de_DE');
+format(12345678901234567890.123, 3, 'de_DE')
+12.345.678.901.234.567.890,123
+SELECT format(12345678901234567890.123, 3, 'en_IN');
+format(12345678901234567890.123, 3, 'en_IN')
+1,23,45,67,89,01,23,45,67,890.123
+SELECT format(12345678901234567890.123, 3, 'en_US');
+format(12345678901234567890.123, 3, 'en_US')
+12,345,678,901,234,567,890.123
+SELECT format(12345678901234567890.123, 3, 'it_CH');
+format(12345678901234567890.123, 3, 'it_CH')
+12'345'678'901'234'567'890,123
+SELECT format(12345678901234567890.123, 3, 'ru_RU');
+format(12345678901234567890.123, 3, 'ru_RU')
+12 345 678 901 234 567 890,123
+SELECT format(12345678901234567890.123, 3, 'ta_IN');
+format(12345678901234567890.123, 3, 'ta_IN')
+1,23,45,67,89,01,23,45,67,890.123
+CREATE TABLE t1 (fmt CHAR(5) NOT NULL);
+INSERT INTO t1 VALUES ('ar_AE');
+INSERT INTO t1 VALUES ('ar_SA');
+INSERT INTO t1 VALUES ('be_BY');
+INSERT INTO t1 VALUES ('de_DE');
+INSERT INTO t1 VALUES ('en_IN');
+INSERT INTO t1 VALUES ('en_US');
+INSERT INTO t1 VALUES ('it_CH');
+INSERT INTO t1 VALUES ('ru_RU');
+INSERT INTO t1 VALUES ('ta_IN');
+SELECT fmt, format(12345678901234567890.123, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(12345678901234567890.123, 3, fmt)
+ar_AE 12,345,678,901,234,567,890.123
+ar_SA 12345678901234567890.123
+be_BY 12.345.678.901.234.567.890,123
+de_DE 12.345.678.901.234.567.890,123
+en_IN 1,23,45,67,89,01,23,45,67,890.123
+en_US 12,345,678,901,234,567,890.123
+it_CH 12'345'678'901'234'567'890,123
+ru_RU 12 345 678 901 234 567 890,123
+ta_IN 1,23,45,67,89,01,23,45,67,890.123
+SELECT fmt, format(12345678901234567890.123, 0, fmt) FROM t1 ORDER BY fmt;
+fmt format(12345678901234567890.123, 0, fmt)
+ar_AE 12,345,678,901,234,567,890
+ar_SA 12345678901234567890
+be_BY 12.345.678.901.234.567.890
+de_DE 12.345.678.901.234.567.890
+en_IN 1,23,45,67,89,01,23,45,67,890
+en_US 12,345,678,901,234,567,890
+it_CH 12'345'678'901'234'567'890
+ru_RU 12 345 678 901 234 567 890
+ta_IN 1,23,45,67,89,01,23,45,67,890
+SELECT fmt, format(12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(12345678901234567890, 3, fmt)
+ar_AE 12,345,678,901,234,567,890.000
+ar_SA 12345678901234567890.000
+be_BY 12.345.678.901.234.567.890,000
+de_DE 12.345.678.901.234.567.890,000
+en_IN 1,23,45,67,89,01,23,45,67,890.000
+en_US 12,345,678,901,234,567,890.000
+it_CH 12'345'678'901'234'567'890,000
+ru_RU 12 345 678 901 234 567 890,000
+ta_IN 1,23,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-12345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-12345678901234567890, 3, fmt)
+ar_AE -12,345,678,901,234,567,890.000
+ar_SA -12345678901234567890.000
+be_BY -12.345.678.901.234.567.890,000
+de_DE -12.345.678.901.234.567.890,000
+en_IN -1,23,45,67,89,01,23,45,67,890.000
+en_US -12,345,678,901,234,567,890.000
+it_CH -12'345'678'901'234'567'890,000
+ru_RU -12 345 678 901 234 567 890,000
+ta_IN -1,23,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-02345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-02345678901234567890, 3, fmt)
+ar_AE -2,345,678,901,234,567,890.000
+ar_SA -2345678901234567890.000
+be_BY -2.345.678.901.234.567.890,000
+de_DE -2.345.678.901.234.567.890,000
+en_IN -23,45,67,89,01,23,45,67,890.000
+en_US -2,345,678,901,234,567,890.000
+it_CH -2'345'678'901'234'567'890,000
+ru_RU -2 345 678 901 234 567 890,000
+ta_IN -23,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-00345678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-00345678901234567890, 3, fmt)
+ar_AE -345,678,901,234,567,890.000
+ar_SA -345678901234567890.000
+be_BY -345.678.901.234.567.890,000
+de_DE -345.678.901.234.567.890,000
+en_IN -3,45,67,89,01,23,45,67,890.000
+en_US -345,678,901,234,567,890.000
+it_CH -345'678'901'234'567'890,000
+ru_RU -345 678 901 234 567 890,000
+ta_IN -3,45,67,89,01,23,45,67,890.000
+SELECT fmt, format(-00045678901234567890, 3, fmt) FROM t1 ORDER BY fmt;
+fmt format(-00045678901234567890, 3, fmt)
+ar_AE -45,678,901,234,567,890.000
+ar_SA -45678901234567890.000
+be_BY -45.678.901.234.567.890,000
+de_DE -45.678.901.234.567.890,000
+en_IN -45,67,89,01,23,45,67,890.000
+en_US -45,678,901,234,567,890.000
+it_CH -45'678'901'234'567'890,000
+ru_RU -45 678 901 234 567 890,000
+ta_IN -45,67,89,01,23,45,67,890.000
+DROP TABLE t1;
+SELECT format(123, 1, 'Non-existent-locale');
+format(123, 1, 'Non-existent-locale')
+123.0
+Warnings:
+Warning 1649 Unknown locale: 'Non-existent-locale'
+End of 5.4 tests
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index a97e6869d09..96a7bafccfc 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -87,7 +87,7 @@ explain extended select - a from t1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select -('1') AS `- a` from `test`.`t1`
+Note 1003 select -('1') AS `- a` from dual
drop table t1;
select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1;
5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 0fa143d95bc..5e72b69c41d 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -814,7 +814,7 @@ create table t1 select last_day('2000-02-05') as a,
from_days(to_days("960101")) as b;
describe t1;
Field Type Null Key Default Extra
-a date NO 0000-00-00
+a date YES NULL
b date YES NULL
select * from t1;
a b
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 92beccd2a9e..542a056c68c 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -13,8 +13,8 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
grant delete on mysqltest.* to mysqltest_1@localhost;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA'
@@ -44,15 +44,15 @@ delete from mysql.user where user='mysqltest_1';
flush privileges;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 0 0 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30;
select * from mysql.user where user="mysqltest_1";
-Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
-localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
+Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv Create_view_priv Show_view_priv Create_routine_priv Alter_routine_priv Create_user_priv Event_priv Trigger_priv Create_tablespace_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections max_user_connections
+localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N N N N N N N N N 10 20 30 0
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30
@@ -387,10 +387,10 @@ SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_3'@'localhost' NULL mysqltest_1 t1 a UPDATE NO
-'mysqltest_3'@'localhost' NULL mysqltest_2 t1 c SELECT NO
-'mysqltest_3'@'localhost' NULL mysqltest_1 t2 b SELECT NO
-'mysqltest_3'@'localhost' NULL mysqltest_2 t2 d UPDATE NO
+'mysqltest_3'@'localhost' def mysqltest_1 t1 a UPDATE NO
+'mysqltest_3'@'localhost' def mysqltest_2 t1 c SELECT NO
+'mysqltest_3'@'localhost' def mysqltest_1 t2 b SELECT NO
+'mysqltest_3'@'localhost' def mysqltest_2 t2 d UPDATE NO
SELECT * FROM INFORMATION_SCHEMA.TABLE_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,PRIVILEGE_TYPE;
@@ -403,7 +403,7 @@ SELECT * from INFORMATION_SCHEMA.USER_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_CATALOG,PRIVILEGE_TYPE;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_3'@'localhost' NULL USAGE NO
+'mysqltest_3'@'localhost' def USAGE NO
update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1;
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1'
update mysqltest_1.t2, mysqltest_2.t2 set d=20 where d=1;
@@ -483,6 +483,7 @@ Show view Tables To see views with SHOW CREATE VIEW
Shutdown Server Admin To shut down the server
Super Server Admin To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
Trigger Tables To use triggers
+Create tablespace Server Admin To create/alter/drop tablespaces
Update Tables To update existing rows
Usage Server Admin No privileges - allow connect only
create database mysqltest;
@@ -710,8 +711,8 @@ GRANT SELECT ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'%' NULL mysqltest SELECT NO
-'mysqltest_8'@'' NULL mysqltest SELECT NO
+'mysqltest_8'@'%' def mysqltest SELECT NO
+'mysqltest_8'@'' def mysqltest SELECT NO
select * from t1;
a
revoke select on mysqltest.* from mysqltest_8@'';
@@ -762,8 +763,8 @@ GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'%' NULL test t1 a UPDATE NO
-'mysqltest_8'@'' NULL test t1 a UPDATE NO
+'mysqltest_8'@'%' def test t1 a UPDATE NO
+'mysqltest_8'@'' def test t1 a UPDATE NO
select * from t1;
a
revoke update (a) on t1 from mysqltest_8@'';
@@ -805,8 +806,8 @@ GRANT USAGE ON *.* TO 'mysqltest_8'@'%'
GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'%' NULL test t1 UPDATE NO
-'mysqltest_8'@'' NULL test t1 UPDATE NO
+'mysqltest_8'@'%' def test t1 UPDATE NO
+'mysqltest_8'@'' def test t1 UPDATE NO
select * from t1;
a
revoke update on t1 from mysqltest_8@'';
@@ -844,9 +845,9 @@ GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'host8' NULL USAGE NO
-'mysqltest_8'@'%' NULL USAGE NO
-'mysqltest_8'@'' NULL USAGE NO
+'mysqltest_8'@'host8' def USAGE NO
+'mysqltest_8'@'%' def USAGE NO
+'mysqltest_8'@'' def USAGE NO
select * from t1;
a
flush privileges;
@@ -869,8 +870,8 @@ GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_8'@'%'
select * from information_schema.user_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_8'@'host8' NULL USAGE NO
-'mysqltest_8'@'%' NULL USAGE NO
+'mysqltest_8'@'host8' def USAGE NO
+'mysqltest_8'@'%' def USAGE NO
drop user mysqltest_8;
connect(localhost,mysqltest_8,,test,MASTER_PORT,MASTER_SOCKET);
ERROR 28000: Access denied for user 'mysqltest_8'@'localhost' (using password: NO)
@@ -914,13 +915,13 @@ SHOW CREATE VIEW mysqltest2.v_ny;
View Create View character_set_client collation_connection
v_ny CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_ny` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` latin1 latin1_swedish_ci
SHOW CREATE TABLE mysqltest3.t_nn;
-ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
+ERROR 42000: SHOW command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
SHOW CREATE VIEW mysqltest3.t_nn;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't_nn'
SHOW CREATE VIEW mysqltest3.v_nn;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
SHOW CREATE TABLE mysqltest3.v_nn;
-ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
+ERROR 42000: SHOW command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
SHOW CREATE TABLE mysqltest2.t_nn;
Table Create Table
t_nn CREATE TABLE `t_nn` (
@@ -1413,3 +1414,713 @@ DROP USER 'user1';
DROP USER 'user1'@'localhost';
DROP USER 'user2';
DROP DATABASE db1;
+#
+# Bug #25863 No database selected error, but documentation
+# says * for global allowed
+#
+GRANT ALL ON * TO mysqltest_1;
+ERROR 3D000: No database selected
+GRANT ALL ON *.* TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+Grants for mysqltest_1@%
+GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
+DROP USER mysqltest_1;
+USE test;
+GRANT ALL ON * TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+Grants for mysqltest_1@%
+GRANT USAGE ON *.* TO 'mysqltest_1'@'%'
+GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'%'
+DROP USER mysqltest_1;
+GRANT ALL ON *.* TO mysqltest_1;
+SHOW GRANTS FOR mysqltest_1;
+Grants for mysqltest_1@%
+GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
+DROP USER mysqltest_1;
+#########################################################################
+#
+# Bug#38347: ALTER ROUTINE privilege allows SHOW CREATE TABLE.
+#
+#########################################################################
+
+# --
+# -- Prepare the environment.
+# --
+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;
+DROP DATABASE IF EXISTS mysqltest_db1;
+CREATE DATABASE mysqltest_db1;
+CREATE TABLE mysqltest_db1.t1(a INT);
+
+# --
+# -- Check that global privileges don't allow SHOW CREATE TABLE.
+# --
+GRANT EVENT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT CREATE TEMPORARY TABLES ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT LOCK TABLES ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT ALTER ROUTINE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT CREATE ROUTINE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT EXECUTE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+GRANT FILE ON *.* TO mysqltest_u1@localhost;
+GRANT CREATE USER ON *.* TO mysqltest_u1@localhost;
+GRANT PROCESS ON *.* TO mysqltest_u1@localhost;
+GRANT RELOAD ON *.* TO mysqltest_u1@localhost;
+GRANT REPLICATION CLIENT ON *.* TO mysqltest_u1@localhost;
+GRANT REPLICATION SLAVE ON *.* TO mysqltest_u1@localhost;
+GRANT SHOW DATABASES ON *.* TO mysqltest_u1@localhost;
+GRANT SHUTDOWN ON *.* TO mysqltest_u1@localhost;
+GRANT USAGE ON *.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT RELOAD, SHUTDOWN, PROCESS, FILE, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE USER ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global SELECT allows SHOW CREATE TABLE.
+# --
+
+GRANT SELECT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SELECT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global INSERT allows SHOW CREATE TABLE.
+# --
+
+GRANT INSERT ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INSERT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global UPDATE allows SHOW CREATE TABLE.
+# --
+
+GRANT UPDATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT UPDATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global DELETE allows SHOW CREATE TABLE.
+# --
+
+GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DELETE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global CREATE allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global DROP allows SHOW CREATE TABLE.
+# --
+
+GRANT DROP ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DROP ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global ALTER allows SHOW CREATE TABLE.
+# --
+
+GRANT ALTER ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT ALTER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global INDEX allows SHOW CREATE TABLE.
+# --
+
+GRANT INDEX ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INDEX ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global REFERENCES allows SHOW CREATE TABLE.
+# --
+
+GRANT REFERENCES ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT REFERENCES ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global GRANT OPTION allows SHOW CREATE TABLE.
+# --
+
+GRANT GRANT OPTION ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global CREATE VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that global SHOW VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT SHOW VIEW ON mysqltest_db1.* TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SHOW VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level SELECT allows SHOW CREATE TABLE.
+# --
+
+GRANT SELECT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SELECT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level INSERT allows SHOW CREATE TABLE.
+# --
+
+GRANT INSERT ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INSERT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level UPDATE allows SHOW CREATE TABLE.
+# --
+
+GRANT UPDATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT UPDATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level DELETE allows SHOW CREATE TABLE.
+# --
+
+GRANT DELETE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DELETE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level CREATE allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level DROP allows SHOW CREATE TABLE.
+# --
+
+GRANT DROP ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT DROP ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level ALTER allows SHOW CREATE TABLE.
+# --
+
+GRANT ALTER ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT ALTER ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level INDEX allows SHOW CREATE TABLE.
+# --
+
+GRANT INDEX ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT INDEX ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level REFERENCES allows SHOW CREATE TABLE.
+# --
+
+GRANT REFERENCES ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT REFERENCES ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level GRANT OPTION allows SHOW CREATE TABLE.
+# --
+
+GRANT GRANT OPTION ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT USAGE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level CREATE VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT CREATE VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT CREATE VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Check that table-level SHOW VIEW allows SHOW CREATE TABLE.
+# --
+
+GRANT SHOW VIEW ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
+
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+GRANT SHOW VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
+
+# connection: con1 (mysqltest_u1@mysqltest_db1)
+
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+# connection: default
+
+REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
+SHOW GRANTS FOR mysqltest_u1@localhost;
+Grants for mysqltest_u1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
+
+# --
+# -- Cleanup.
+# --
+
+DROP DATABASE mysqltest_db1;
+DROP USER mysqltest_u1@localhost;
+
+# End of Bug#38347.
+
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 12269f0cb1c..3032ca854bd 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -121,9 +121,9 @@ mysqltest_5@host5, mysqltest_6@host6, mysqltest_7@host7;
create database mysqltest_1;
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
set sql_log_off = 1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
set sql_log_bin = 0;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
delete from mysql.user where user like 'mysqltest\_1';
delete from mysql.db where user like 'mysqltest\_1';
drop database mysqltest_1;
@@ -391,7 +391,7 @@ grant all on mysqltest_1.* to mysqltest_u1@localhost;
use mysqltest_2;
create table t1 (i int);
show create table mysqltest_2.t1;
-ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
create table t1 like mysqltest_2.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
grant select on mysqltest_2.t1 to mysqltest_u1@localhost;
diff --git a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result
new file mode 100644
index 00000000000..28ad9d04151
--- /dev/null
+++ b/mysql-test/r/grant4.result
@@ -0,0 +1,123 @@
+drop database if exists mysqltest_db1;
+create database mysqltest_db1;
+use mysqltest_db1;
+create table t_column_priv_only (a int, b int);
+create table t_select_priv like t_column_priv_only;
+create table t_no_priv like t_column_priv_only;
+grant all privileges on test.* to mysqltest_u1@localhost;
+grant insert (a) on mysqltest_db1.t_column_priv_only to mysqltest_u1@localhost;
+grant select on mysqltest_db1.t_select_priv to mysqltest_u1@localhost;
+** Connect as restricted user mysqltest_u1.
+
+** Test column level privileges only. No SELECT privileges on the table.
+** INSERT INTO ... VALUES ...
+** Attempting to insert values to a table with only column privileges
+** should work.
+insert into mysqltest_db1.t_column_priv_only (a) VALUES (1);
+
+** SHOW COLUMNS
+** Should succeed because we have privileges (any) on at least one of the columns.
+select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_column_priv_only';
+Field Type Null Key Default Extra
+a int(11) YES NULL
+show columns from mysqltest_db1.t_column_priv_only;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+** SHOW COLUMNS
+** Should fail because there are no privileges on any column combination.
+show columns from mysqltest_db1.t_no_priv;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't_no_priv'
+** However, select from I_S.COLUMNS will succeed but not show anything:
+select column_name as 'Field',column_type as 'Type',is_nullable as 'Null',column_key as 'Key',column_default as 'Default',extra as 'Extra' from information_schema.columns where table_schema='mysqltest_db1' and table_name='t_no_priv';
+Field Type Null Key Default Extra
+
+** CREATE TABLE ... LIKE ... require SELECT privleges and will fail.
+create table test.t_no_priv like mysqltest_db1.column_priv_only;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'column_priv_only'
+
+** Just to be sure... SELECT also fails.
+select * from mysqltest_db1.t_column_priv_only;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't_column_priv_only'
+
+** SHOW CREATE TABLE ... require any privileges on all columns (the entire table).
+** First we try and fail on a table with only one column privilege.
+show create table mysqltest_db1.t_column_priv_only;
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't_column_priv_only'
+
+** Now we do the same on a table with SELECT privileges.
+
+** SHOW COLUMNS
+** Success because we got some privileges on the table (SELECT_ACL)
+show columns from mysqltest_db1.t_select_priv;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b int(11) YES NULL
+
+** CREATE TABLE ... LIKE ... require SELECT privleges and will SUCCEED.
+drop table if exists test.t_duplicated;
+create table test.t_duplicated like mysqltest_db1.t_select_priv;
+drop table test.t_duplicated;
+
+** SHOW CREATE TABLE will succeed because we have a privilege on all columns in the table (table-level privilege).
+show create table mysqltest_db1.t_select_priv;
+Table Create Table
+t_select_priv CREATE TABLE `t_select_priv` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+
+** SHOW CREATE TABLE will fail if there is no grants at all:
+show create table mysqltest_db1.t_no_priv;
+ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't_no_priv'
+
+use mysqltest_db1;
+CREATE TABLE t5 (s1 INT);
+CREATE INDEX i ON t5 (s1);
+CREATE TABLE t6 (s1 INT, s2 INT);
+CREATE VIEW v5 AS SELECT * FROM t5;
+CREATE VIEW v6 AS SELECT * FROM t6;
+CREATE VIEW v2 AS SELECT * FROM t_select_priv;
+CREATE VIEW v3 AS SELECT * FROM t_select_priv;
+CREATE INDEX i ON t6 (s1);
+GRANT UPDATE (s2) ON t6 to mysqltest_u1@localhost;
+GRANT UPDATE (s2) ON v6 to mysqltest_u1@localhost;
+GRANT SHOW VIEW ON v2 to mysqltest_u1@localhost;
+GRANT SHOW VIEW, SELECT ON v3 to mysqltest_u1@localhost;
+use mysqltest_db1;
+** Connect as restricted user mysqltest_u1.
+** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do (authentication is enough).
+SELECT * FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name='t5';
+TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
+def mysqltest_db1 t5 1 mysqltest_db1 i 1 s1 A NULL NULL NULL YES BTREE
+** SHOW INDEX FROM t5 will fail because we don't have any privileges on any column combination.
+SHOW INDEX FROM t5;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5'
+** SHOW INDEX FROM t6 will succeed because there exist a privilege on a column combination on t6.
+SHOW INDEX FROM t6;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t6 1 i 1 s1 A NULL NULL NULL YES BTREE
+** CHECK TABLE requires any privilege on any column combination and should succeed for t6:
+CHECK TABLE t6;
+Table Op Msg_type Msg_text
+mysqltest_db1.t6 check status OK
+** With no privileges access is naturally denied:
+CHECK TABLE t5;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't5'
+** CHECKSUM TABLE requires SELECT privileges on the table. The following should fail:
+CHECKSUM TABLE t6;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't6'
+** And this should work:
+CHECKSUM TABLE t_select_priv;
+Table Checksum
+mysqltest_db1.t_select_priv 0
+SHOW CREATE VIEW v5;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v5'
+SHOW CREATE VIEW v6;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v6'
+SHOW CREATE VIEW v2;
+ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 'v2'
+SHOW CREATE VIEW v3;
+View Create View character_set_client collation_connection
+v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t_select_priv`.`a` AS `a`,`t_select_priv`.`b` AS `b` from `t_select_priv` latin1 latin1_swedish_ci
+drop database mysqltest_db1;
+drop user mysqltest_u1@localhost;
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index 662cc5be034..ba1c2a79ad9 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -1800,23 +1800,23 @@ b
a
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
+1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
+1 SIMPLE t1 range NULL idx_t1_1 163 NULL 65 Using where; Using index for group-by (scanning)
explain extended select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
+1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 100.00 Using where; Using index for group-by
Warnings:
Note 1003 select count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`) AS `count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`b` = 'c') and (`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a'))
explain select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
-explain extended select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
+explain extended select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
id select_type table type possible_keys key key_len ref rows filtered Extra
-1 SIMPLE t1 index idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_2 147 NULL 128 75.00 Using where; Using index
+1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 14 100.00 Using where; Using index for group-by
Warnings:
-Note 1003 select (ord(`test`.`t1`.`a1`) + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`)) AS `ord(a1) + count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a'))
+Note 1003 select (98 + count(distinct `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`)) AS `98 + count(distinct a1,a2,b)` from `test`.`t1` where ((`test`.`t1`.`a1` > 'a') and (`test`.`t1`.`a2` > 'a'))
select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
count(distinct a1,a2,b)
4
@@ -1829,8 +1829,8 @@ count(distinct a1,a2,b)
select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
count(distinct b)
1
-select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
-ord(a1) + count(distinct a1,a2,b)
+select 98 + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
+98 + count(distinct a1,a2,b)
104
explain select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
@@ -2525,3 +2525,257 @@ a MAX(b)
2 1
DROP TABLE t;
End of 5.1 tests
+#
+# WL#3220 (Loose index scan for COUNT DISTINCT)
+#
+CREATE TABLE t1 (a INT, b INT, c INT, KEY (a,b));
+INSERT INTO t1 VALUES (1,1,1), (1,2,1), (1,3,1), (1,4,1);
+INSERT INTO t1 SELECT a, b + 4, 1 FROM t1;
+INSERT INTO t1 SELECT a + 1, b, 1 FROM t1;
+CREATE TABLE t2 (a INT, b INT, c INT, d INT, e INT, f INT, KEY (a,b,c));
+INSERT INTO t2 VALUES (1,1,1,1,1,1), (1,2,1,1,1,1), (1,3,1,1,1,1),
+(1,4,1,1,1,1);
+INSERT INTO t2 SELECT a, b + 4, c,d,e,f FROM t2;
+INSERT INTO t2 SELECT a + 1, b, c,d,e,f FROM t2;
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+2
+EXPLAIN SELECT COUNT(DISTINCT a,b) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a,b) FROM t1;
+COUNT(DISTINCT a,b)
+16
+EXPLAIN SELECT COUNT(DISTINCT b,a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT b,a) FROM t1;
+COUNT(DISTINCT b,a)
+16
+EXPLAIN SELECT COUNT(DISTINCT b) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
+SELECT COUNT(DISTINCT b) FROM t1;
+COUNT(DISTINCT b)
+8
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a) FROM t1 GROUP BY a;
+COUNT(DISTINCT a)
+1
+1
+EXPLAIN SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT b) FROM t1 GROUP BY a;
+COUNT(DISTINCT b)
+8
+8
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 GROUP BY b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index; Using filesort
+SELECT COUNT(DISTINCT a) FROM t1 GROUP BY b;
+COUNT(DISTINCT a)
+2
+2
+2
+2
+2
+2
+2
+2
+EXPLAIN SELECT DISTINCT COUNT(DISTINCT a) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
+SELECT DISTINCT COUNT(DISTINCT a) FROM t1;
+COUNT(DISTINCT a)
+2
+EXPLAIN SELECT COUNT(DISTINCT a, b + 0) FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 10 NULL 16 Using index
+SELECT COUNT(DISTINCT a, b + 0) FROM t1;
+COUNT(DISTINCT a, b + 0)
+16
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT b) < 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT b) < 10;
+COUNT(DISTINCT a)
+EXPLAIN SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT c) < 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a) FROM t1 HAVING COUNT(DISTINCT c) < 10;
+COUNT(DISTINCT a)
+2
+EXPLAIN SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT 1 FROM t1 HAVING COUNT(DISTINCT a) < 10;
+1
+1
+EXPLAIN SELECT 1 FROM t1 GROUP BY a HAVING COUNT(DISTINCT b) > 1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 10 NULL 9 Using index for group-by
+SELECT 1 FROM t1 GROUP BY a HAVING COUNT(DISTINCT b) > 1;
+1
+1
+1
+EXPLAIN SELECT COUNT(DISTINCT t1_1.a) FROM t1 t1_1, t1 t1_2 GROUP BY t1_1.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1_1 index NULL a 10 NULL 16 Using index; Using temporary; Using filesort
+1 SIMPLE t1_2 index NULL a 10 NULL 16 Using index; Using join buffer
+SELECT COUNT(DISTINCT t1_1.a) FROM t1 t1_1, t1 t1_2 GROUP BY t1_1.a;
+COUNT(DISTINCT t1_1.a)
+1
+1
+EXPLAIN SELECT COUNT(DISTINCT a), 12 FROM t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a), 12 FROM t1;
+COUNT(DISTINCT a) 12
+2 12
+EXPLAIN SELECT COUNT(DISTINCT a, b, c) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a, b, c) FROM t2;
+COUNT(DISTINCT a, b, c)
+16
+EXPLAIN SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT a) FROM t2;
+COUNT(DISTINCT a) SUM(DISTINCT a) AVG(DISTINCT a)
+2 3 1.5000
+EXPLAIN SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT f) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a), SUM(DISTINCT a), AVG(DISTINCT f) FROM t2;
+COUNT(DISTINCT a) SUM(DISTINCT a) AVG(DISTINCT f)
+2 3 1.0000
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, a) FROM t2;
+COUNT(DISTINCT a, b) COUNT(DISTINCT b, a)
+16 16
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, f) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, f) FROM t2;
+COUNT(DISTINCT a, b) COUNT(DISTINCT b, f)
+16 8
+EXPLAIN SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, d) FROM t2;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16
+SELECT COUNT(DISTINCT a, b), COUNT(DISTINCT b, d) FROM t2;
+COUNT(DISTINCT a, b) COUNT(DISTINCT b, d)
+16 8
+EXPLAIN SELECT a, c, COUNT(DISTINCT c, a, b) FROM t2 GROUP BY a, b, c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using index for group-by
+SELECT a, c, COUNT(DISTINCT c, a, b) FROM t2 GROUP BY a, b, c;
+a c COUNT(DISTINCT c, a, b)
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+1 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+2 1 1
+EXPLAIN SELECT COUNT(DISTINCT c, a, b) FROM t2
+WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range a a 15 NULL 1 Using where; Using index for group-by
+SELECT COUNT(DISTINCT c, a, b) FROM t2
+WHERE a > 5 AND b BETWEEN 10 AND 20 GROUP BY a, b, c;
+COUNT(DISTINCT c, a, b)
+EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 WHERE a = 5
+GROUP BY b;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ref a a 5 const 1 Using where; Using index
+SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 WHERE a = 5
+GROUP BY b;
+COUNT(DISTINCT b) SUM(DISTINCT b)
+EXPLAIN SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
+SELECT a, COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+a COUNT(DISTINCT b) SUM(DISTINCT b)
+2 8 36
+2 8 36
+EXPLAIN SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using index for group-by
+SELECT COUNT(DISTINCT b), SUM(DISTINCT b) FROM t2 GROUP BY a;
+COUNT(DISTINCT b) SUM(DISTINCT b)
+8 36
+8 36
+EXPLAIN SELECT COUNT(DISTINCT a, b) FROM t2 WHERE c = 13 AND d = 42;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 ALL NULL NULL NULL NULL 16 Using where
+SELECT COUNT(DISTINCT a, b) FROM t2 WHERE c = 13 AND d = 42;
+COUNT(DISTINCT a, b)
+0
+EXPLAIN SELECT a, COUNT(DISTINCT a), SUM(DISTINCT a) FROM t2
+WHERE b = 13 AND c = 42 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using where; Using index for group-by
+SELECT a, COUNT(DISTINCT a), SUM(DISTINCT a) FROM t2
+WHERE b = 13 AND c = 42 GROUP BY a;
+a COUNT(DISTINCT a) SUM(DISTINCT a)
+EXPLAIN SELECT COUNT(DISTINCT a, b), SUM(DISTINCT a) FROM t2 WHERE b = 42;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 10 NULL 9 Using where; Using index for group-by
+SELECT COUNT(DISTINCT a, b), SUM(DISTINCT a) FROM t2 WHERE b = 42;
+COUNT(DISTINCT a, b) SUM(DISTINCT a)
+0 NULL
+EXPLAIN SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+SELECT SUM(DISTINCT a), MAX(b) FROM t2 GROUP BY a;
+SUM(DISTINCT a) MAX(b)
+1 8
+2 8
+EXPLAIN SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 15 NULL 9 Using index for group-by
+SELECT 42 * (a + c + COUNT(DISTINCT c, a, b)) FROM t2 GROUP BY a, b, c;
+42 * (a + c + COUNT(DISTINCT c, a, b))
+126
+126
+126
+126
+126
+126
+126
+168
+168
+168
+168
+168
+168
+168
+168
+168
+EXPLAIN SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 range NULL a 5 NULL 9 Using index for group-by
+SELECT (SUM(DISTINCT a) + MAX(b)) FROM t2 GROUP BY a;
+(SUM(DISTINCT a) + MAX(b))
+9
+10
+DROP TABLE t1,t2;
+# end of WL#3220 tests
diff --git a/mysql-test/r/have_community_features.require b/mysql-test/r/have_community_features.require
deleted file mode 100644
index 9233bba91e1..00000000000
--- a/mysql-test/r/have_community_features.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-have_community_features YES
diff --git a/mysql-test/r/have_nodebug.require b/mysql-test/r/have_nodebug.require
new file mode 100644
index 00000000000..ff251521aa8
--- /dev/null
+++ b/mysql-test/r/have_nodebug.require
@@ -0,0 +1,2 @@
+debug
+0
diff --git a/mysql-test/r/have_profiling.require b/mysql-test/r/have_profiling.require
new file mode 100644
index 00000000000..453ee5bb084
--- /dev/null
+++ b/mysql-test/r/have_profiling.require
@@ -0,0 +1,2 @@
+Variable_name Value
+have_profiling YES
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 9c3cc8fc89e..f0b934ebd3a 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -12,7 +12,7 @@ explain extended select count(a) as b from t1 where a=0 having b >=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
-Note 1003 select count('0') AS `b` from `test`.`t1` where 0 having (`b` >= 0)
+Note 1003 select count('0') AS `b` from dual where 0 having (`b` >= 0)
drop table t1;
CREATE TABLE t1 (
raw_id int(10) NOT NULL default '0',
diff --git a/mysql-test/r/information_schema-big.result b/mysql-test/r/information_schema-big.result
new file mode 100644
index 00000000000..248b8d606dc
--- /dev/null
+++ b/mysql-test/r/information_schema-big.result
@@ -0,0 +1,93 @@
+DROP TABLE IF EXISTS t0,t1,t2,t3,t4,t5;
+DROP VIEW IF EXISTS v1;
+#
+# Bug#18925: subqueries with MIN/MAX functions on INFORMARTION_SCHEMA
+#
+SELECT t.table_name, c1.column_name
+FROM information_schema.tables t
+INNER JOIN
+information_schema.columns c1
+ON t.table_schema = c1.table_schema AND
+t.table_name = c1.table_name
+WHERE t.table_schema = 'information_schema' AND
+c1.ordinal_position =
+( SELECT COALESCE(MIN(c2.ordinal_position),1)
+FROM information_schema.columns c2
+WHERE c2.table_schema = t.table_schema AND
+c2.table_name = t.table_name AND
+c2.column_name LIKE '%SCHEMA%'
+ )
+AND t.table_name NOT LIKE 'innodb%';
+table_name column_name
+CHARACTER_SETS CHARACTER_SET_NAME
+COLLATIONS COLLATION_NAME
+COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
+COLUMNS TABLE_SCHEMA
+COLUMN_PRIVILEGES TABLE_SCHEMA
+ENGINES ENGINE
+EVENTS EVENT_SCHEMA
+FILES TABLE_SCHEMA
+GLOBAL_STATUS VARIABLE_NAME
+GLOBAL_VARIABLES VARIABLE_NAME
+KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+PARTITIONS TABLE_SCHEMA
+PLUGINS PLUGIN_NAME
+PROCESSLIST ID
+PROFILING QUERY_ID
+REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
+ROUTINES ROUTINE_SCHEMA
+SCHEMATA SCHEMA_NAME
+SCHEMA_PRIVILEGES TABLE_SCHEMA
+SESSION_STATUS VARIABLE_NAME
+SESSION_VARIABLES VARIABLE_NAME
+STATISTICS TABLE_SCHEMA
+TABLES TABLE_SCHEMA
+TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
+TABLE_PRIVILEGES TABLE_SCHEMA
+TRIGGERS TRIGGER_SCHEMA
+USER_PRIVILEGES GRANTEE
+VIEWS TABLE_SCHEMA
+SELECT t.table_name, c1.column_name
+FROM information_schema.tables t
+INNER JOIN
+information_schema.columns c1
+ON t.table_schema = c1.table_schema AND
+t.table_name = c1.table_name
+WHERE t.table_schema = 'information_schema' AND
+c1.ordinal_position =
+( SELECT COALESCE(MIN(c2.ordinal_position),1)
+FROM information_schema.columns c2
+WHERE c2.table_schema = 'information_schema' AND
+c2.table_name = t.table_name AND
+c2.column_name LIKE '%SCHEMA%'
+ )
+AND t.table_name NOT LIKE 'innodb%';
+table_name column_name
+CHARACTER_SETS CHARACTER_SET_NAME
+COLLATIONS COLLATION_NAME
+COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
+COLUMNS TABLE_SCHEMA
+COLUMN_PRIVILEGES TABLE_SCHEMA
+ENGINES ENGINE
+EVENTS EVENT_SCHEMA
+FILES TABLE_SCHEMA
+GLOBAL_STATUS VARIABLE_NAME
+GLOBAL_VARIABLES VARIABLE_NAME
+KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
+PARTITIONS TABLE_SCHEMA
+PLUGINS PLUGIN_NAME
+PROCESSLIST ID
+PROFILING QUERY_ID
+REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
+ROUTINES ROUTINE_SCHEMA
+SCHEMATA SCHEMA_NAME
+SCHEMA_PRIVILEGES TABLE_SCHEMA
+SESSION_STATUS VARIABLE_NAME
+SESSION_VARIABLES VARIABLE_NAME
+STATISTICS TABLE_SCHEMA
+TABLES TABLE_SCHEMA
+TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
+TABLE_PRIVILEGES TABLE_SCHEMA
+TRIGGERS TRIGGER_SCHEMA
+USER_PRIVILEGES GRANTEE
+VIEWS TABLE_SCHEMA
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index ffa9b596d2f..04234eb3cc4 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -9,9 +9,9 @@ create user mysqltest_3@localhost;
create user mysqltest_3;
select * from information_schema.SCHEMATA where schema_name > 'm';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL mtr latin1 latin1_swedish_ci NULL
-NULL mysql latin1 latin1_swedish_ci NULL
-NULL test latin1 latin1_swedish_ci NULL
+def mtr latin1 latin1_swedish_ci NULL
+def mysql latin1 latin1_swedish_ci NULL
+def test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata;
schema_name
information_schema
@@ -162,7 +162,7 @@ t1
t4
select * from information_schema.STATISTICS where TABLE_SCHEMA = "mysqltest";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT
-NULL mysqltest t1 1 mysqltest string_data 1 b A NULL NULL NULL YES BTREE
+def mysqltest t1 1 mysqltest string_data 1 b A NULL NULL NULL YES BTREE
show keys from t3 where Key_name = "a_data";
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t3 1 a_data 1 a A NULL NULL NULL YES BTREE
@@ -189,7 +189,7 @@ c varchar(64) utf8_general_ci NO select,insert,update,references
select * from information_schema.COLUMNS where table_name="t1"
and column_name= "a";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-NULL mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
+def mysqltest t1 a 1 NULL YES int NULL NULL 10 0 NULL NULL int(11) select,insert,update,references
show columns from mysqltest.t1 where field like "%a%";
Field Type Null Key Default Extra
a int(11) YES NULL
@@ -394,11 +394,11 @@ show keys from v4;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
select * from information_schema.views where TABLE_NAME like "v%";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v0 select `schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v1 select `tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v2 select `columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v3 select `character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v4 select `collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v0 select `information_schema`.`schemata`.`SCHEMA_NAME` AS `c` from `information_schema`.`schemata` NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v1 select `information_schema`.`tables`.`TABLE_NAME` AS `c` from `information_schema`.`tables` where (`information_schema`.`tables`.`TABLE_NAME` = 'v1') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v2 select `information_schema`.`columns`.`COLUMN_NAME` AS `c` from `information_schema`.`columns` where (`information_schema`.`columns`.`TABLE_NAME` = 'v2') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v3 select `information_schema`.`character_sets`.`CHARACTER_SET_NAME` AS `c` from `information_schema`.`character_sets` where (`information_schema`.`character_sets`.`CHARACTER_SET_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
+def test v4 select `information_schema`.`collations`.`COLLATION_NAME` AS `c` from `information_schema`.`collations` where (`information_schema`.`collations`.`COLLATION_NAME` like 'latin1%') NONE NO root@localhost DEFINER latin1 latin1_swedish_ci
drop view v0, v1, v2, v3, v4;
create table t1 (a int);
grant select,update,insert on t1 to mysqltest_1@localhost;
@@ -406,38 +406,38 @@ grant select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@local
grant all on test.* to mysqltest_1@localhost with grant option;
select * from information_schema.USER_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL USAGE NO
+'mysqltest_1'@'localhost' def USAGE NO
select * from information_schema.SCHEMA_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL test SELECT YES
-'mysqltest_1'@'localhost' NULL test INSERT YES
-'mysqltest_1'@'localhost' NULL test UPDATE YES
-'mysqltest_1'@'localhost' NULL test DELETE YES
-'mysqltest_1'@'localhost' NULL test CREATE YES
-'mysqltest_1'@'localhost' NULL test DROP YES
-'mysqltest_1'@'localhost' NULL test REFERENCES YES
-'mysqltest_1'@'localhost' NULL test INDEX YES
-'mysqltest_1'@'localhost' NULL test ALTER YES
-'mysqltest_1'@'localhost' NULL test CREATE TEMPORARY TABLES YES
-'mysqltest_1'@'localhost' NULL test LOCK TABLES YES
-'mysqltest_1'@'localhost' NULL test EXECUTE YES
-'mysqltest_1'@'localhost' NULL test CREATE VIEW YES
-'mysqltest_1'@'localhost' NULL test SHOW VIEW YES
-'mysqltest_1'@'localhost' NULL test CREATE ROUTINE YES
-'mysqltest_1'@'localhost' NULL test ALTER ROUTINE YES
-'mysqltest_1'@'localhost' NULL test EVENT YES
-'mysqltest_1'@'localhost' NULL test TRIGGER YES
+'mysqltest_1'@'localhost' def test SELECT YES
+'mysqltest_1'@'localhost' def test INSERT YES
+'mysqltest_1'@'localhost' def test UPDATE YES
+'mysqltest_1'@'localhost' def test DELETE YES
+'mysqltest_1'@'localhost' def test CREATE YES
+'mysqltest_1'@'localhost' def test DROP YES
+'mysqltest_1'@'localhost' def test REFERENCES YES
+'mysqltest_1'@'localhost' def test INDEX YES
+'mysqltest_1'@'localhost' def test ALTER YES
+'mysqltest_1'@'localhost' def test CREATE TEMPORARY TABLES YES
+'mysqltest_1'@'localhost' def test LOCK TABLES YES
+'mysqltest_1'@'localhost' def test EXECUTE YES
+'mysqltest_1'@'localhost' def test CREATE VIEW YES
+'mysqltest_1'@'localhost' def test SHOW VIEW YES
+'mysqltest_1'@'localhost' def test CREATE ROUTINE YES
+'mysqltest_1'@'localhost' def test ALTER ROUTINE YES
+'mysqltest_1'@'localhost' def test EVENT YES
+'mysqltest_1'@'localhost' def test TRIGGER YES
select * from information_schema.TABLE_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL test t1 SELECT NO
-'mysqltest_1'@'localhost' NULL test t1 INSERT NO
-'mysqltest_1'@'localhost' NULL test t1 UPDATE NO
+'mysqltest_1'@'localhost' def test t1 SELECT NO
+'mysqltest_1'@'localhost' def test t1 INSERT NO
+'mysqltest_1'@'localhost' def test t1 UPDATE NO
select * from information_schema.COLUMN_PRIVILEGES where grantee like '%mysqltest_1%';
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'mysqltest_1'@'localhost' NULL test t1 a SELECT NO
-'mysqltest_1'@'localhost' NULL test t1 a INSERT NO
-'mysqltest_1'@'localhost' NULL test t1 a UPDATE NO
-'mysqltest_1'@'localhost' NULL test t1 a REFERENCES NO
+'mysqltest_1'@'localhost' def test t1 a SELECT NO
+'mysqltest_1'@'localhost' def test t1 a INSERT NO
+'mysqltest_1'@'localhost' def test t1 a UPDATE NO
+'mysqltest_1'@'localhost' def test t1 a REFERENCES NO
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%';
@@ -460,17 +460,17 @@ t1 CREATE TABLE `t1` (
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL test PRIMARY test t1 PRIMARY KEY
-NULL test constraint_1 test t1 UNIQUE
-NULL test key_1 test t1 UNIQUE
-NULL test key_2 test t1 UNIQUE
+def test PRIMARY test t1 PRIMARY KEY
+def test constraint_1 test t1 UNIQUE
+def test key_1 test t1 UNIQUE
+def test key_2 test t1 UNIQUE
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
-NULL test PRIMARY NULL test t1 a 1 NULL NULL NULL NULL
-NULL test constraint_1 NULL test t1 a 1 NULL NULL NULL NULL
-NULL test key_1 NULL test t1 a 1 NULL NULL NULL NULL
-NULL test key_2 NULL test t1 a 1 NULL NULL NULL NULL
+def test PRIMARY def test t1 a 1 NULL NULL NULL NULL
+def test constraint_1 def test t1 a 1 NULL NULL NULL NULL
+def test key_1 def test t1 a 1 NULL NULL NULL NULL
+def test key_2 def test t1 a 1 NULL NULL NULL NULL
select table_name from information_schema.TABLES where table_schema like "test%";
table_name
t1
@@ -491,13 +491,13 @@ create view v2 (c) as select a from t1 WITH LOCAL CHECK OPTION;
create view v3 (c) as select a from t1 WITH CASCADED CHECK OPTION;
select * from information_schema.views;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v1 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v2 select `test`.`t1`.`a` AS `c` from `test`.`t1` LOCAL YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v3 select `test`.`t1`.`a` AS `c` from `test`.`t1` CASCADED YES root@localhost DEFINER latin1 latin1_swedish_ci
grant select (a) on test.t1 to joe@localhost with grant option;
select * from INFORMATION_SCHEMA.COLUMN_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'joe'@'localhost' NULL test t1 a SELECT YES
+'joe'@'localhost' def test t1 a SELECT YES
select * from INFORMATION_SCHEMA.TABLE_PRIVILEGES;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
drop view v1, v2, v3;
@@ -592,7 +592,7 @@ proc definer char(77)
proc created timestamp
proc modified timestamp
proc sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH')
-proc comment char(64)
+proc comment text
proc character_set_client char(32)
proc collation_connection char(32)
proc db_collation char(32)
@@ -641,7 +641,7 @@ TABLE_CONSTRAINTS SYSTEM VIEW
TABLE_PRIVILEGES SYSTEM VIEW
TRIGGERS SYSTEM VIEW
create table t1(a int);
-ERROR 42S02: Unknown table 't1' in information_schema
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
use test;
show tables;
Tables_in_test
@@ -771,6 +771,7 @@ information_schema PARTITIONS PARTITION_DESCRIPTION
information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
information_schema ROUTINES ROUTINE_DEFINITION
+information_schema ROUTINES ROUTINE_COMMENT
information_schema TRIGGERS ACTION_CONDITION
information_schema TRIGGERS ACTION_STATEMENT
information_schema VIEWS VIEW_DEFINITION
@@ -894,17 +895,17 @@ end if;
end AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
select * from information_schema.triggers where trigger_schema in ('mysql', 'information_schema', 'test', 'mysqltest');
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL test trg1 INSERT NULL test t1 0 NULL begin
+def test trg1 INSERT def test t1 0 NULL begin
if new.j > 10 then
set new.j := 10;
end if;
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-NULL test trg2 UPDATE NULL test t1 0 NULL begin
+def test trg2 UPDATE def test t1 0 NULL begin
if old.i % 2 = 0 then
set new.j := -1;
end if;
end ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-NULL test trg3 UPDATE NULL test t1 0 NULL begin
+def test trg3 UPDATE def test t1 0 NULL begin
if new.j = -1 then
set @fired:= "Yes";
end if;
@@ -922,14 +923,14 @@ grant select on mysqltest.* to user3@localhost;
grant select on *.* to user4@localhost;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL mysqltest t1 f1 SELECT NO
+'user1'@'localhost' def mysqltest t1 f1 SELECT NO
select * from information_schema.table_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.schema_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.user_privileges order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL USAGE NO
+'user1'@'localhost' def USAGE NO
show grants;
Grants for user1@localhost
GRANT USAGE ON *.* TO 'user1'@'localhost'
@@ -938,12 +939,12 @@ select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.table_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user2'@'localhost' NULL mysqltest t2 SELECT NO
+'user2'@'localhost' def mysqltest t2 SELECT NO
select * from information_schema.schema_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.user_privileges order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user2'@'localhost' NULL USAGE NO
+'user2'@'localhost' def USAGE NO
show grants;
Grants for user2@localhost
GRANT USAGE ON *.* TO 'user2'@'localhost'
@@ -954,10 +955,10 @@ select * from information_schema.table_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.schema_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'user3'@'localhost' NULL mysqltest SELECT NO
+'user3'@'localhost' def mysqltest SELECT NO
select * from information_schema.user_privileges order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user3'@'localhost' NULL USAGE NO
+'user3'@'localhost' def USAGE NO
show grants;
Grants for user3@localhost
GRANT USAGE ON *.* TO 'user3'@'localhost'
@@ -965,22 +966,22 @@ GRANT SELECT ON `mysqltest`.* TO 'user3'@'localhost'
select * from information_schema.column_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL mysqltest t1 f1 SELECT NO
+'user1'@'localhost' def mysqltest t1 f1 SELECT NO
select * from information_schema.table_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user2'@'localhost' NULL mysqltest t2 SELECT NO
+'user2'@'localhost' def mysqltest t2 SELECT NO
select * from information_schema.schema_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-'user3'@'localhost' NULL mysqltest SELECT NO
+'user3'@'localhost' def mysqltest SELECT NO
select * from information_schema.user_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
-'user1'@'localhost' NULL USAGE NO
-'user2'@'localhost' NULL USAGE NO
-'user3'@'localhost' NULL USAGE NO
-'user4'@'localhost' NULL SELECT NO
+'user1'@'localhost' def USAGE NO
+'user2'@'localhost' def USAGE NO
+'user3'@'localhost' def USAGE NO
+'user4'@'localhost' def SELECT NO
show grants;
Grants for user4@localhost
GRANT SELECT ON *.* TO 'user4'@'localhost'
@@ -1176,8 +1177,8 @@ sql security definer view v2 as select 1;
select * from information_schema.views
where table_name='v1' or table_name='v2';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
-NULL test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
+def test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci
+def test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci
drop view v1, v2;
drop table t1;
drop user mysqltest_1@localhost;
@@ -1226,94 +1227,6 @@ f1()
DROP FUNCTION f1;
DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost;
-SELECT t.table_name, c1.column_name
-FROM information_schema.tables t
-INNER JOIN
-information_schema.columns c1
-ON t.table_schema = c1.table_schema AND
-t.table_name = c1.table_name
-WHERE t.table_schema = 'information_schema' AND
-c1.ordinal_position =
-( SELECT COALESCE(MIN(c2.ordinal_position),1)
-FROM information_schema.columns c2
-WHERE c2.table_schema = t.table_schema AND
-c2.table_name = t.table_name AND
-c2.column_name LIKE '%SCHEMA%'
- )
-AND t.table_name not like 'innodb_%';
-table_name column_name
-CHARACTER_SETS CHARACTER_SET_NAME
-COLLATIONS COLLATION_NAME
-COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
-COLUMNS TABLE_SCHEMA
-COLUMN_PRIVILEGES TABLE_SCHEMA
-ENGINES ENGINE
-EVENTS EVENT_SCHEMA
-FILES TABLE_SCHEMA
-GLOBAL_STATUS VARIABLE_NAME
-GLOBAL_VARIABLES VARIABLE_NAME
-KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
-PARTITIONS TABLE_SCHEMA
-PLUGINS PLUGIN_NAME
-PROCESSLIST ID
-PROFILING QUERY_ID
-REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
-ROUTINES ROUTINE_SCHEMA
-SCHEMATA SCHEMA_NAME
-SCHEMA_PRIVILEGES TABLE_SCHEMA
-SESSION_STATUS VARIABLE_NAME
-SESSION_VARIABLES VARIABLE_NAME
-STATISTICS TABLE_SCHEMA
-TABLES TABLE_SCHEMA
-TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
-TABLE_PRIVILEGES TABLE_SCHEMA
-TRIGGERS TRIGGER_SCHEMA
-USER_PRIVILEGES GRANTEE
-VIEWS TABLE_SCHEMA
-SELECT t.table_name, c1.column_name
-FROM information_schema.tables t
-INNER JOIN
-information_schema.columns c1
-ON t.table_schema = c1.table_schema AND
-t.table_name = c1.table_name
-WHERE t.table_schema = 'information_schema' AND
-c1.ordinal_position =
-( SELECT COALESCE(MIN(c2.ordinal_position),1)
-FROM information_schema.columns c2
-WHERE c2.table_schema = 'information_schema' AND
-c2.table_name = t.table_name AND
-c2.column_name LIKE '%SCHEMA%'
- )
-AND t.table_name not like 'innodb_%';
-table_name column_name
-CHARACTER_SETS CHARACTER_SET_NAME
-COLLATIONS COLLATION_NAME
-COLLATION_CHARACTER_SET_APPLICABILITY COLLATION_NAME
-COLUMNS TABLE_SCHEMA
-COLUMN_PRIVILEGES TABLE_SCHEMA
-ENGINES ENGINE
-EVENTS EVENT_SCHEMA
-FILES TABLE_SCHEMA
-GLOBAL_STATUS VARIABLE_NAME
-GLOBAL_VARIABLES VARIABLE_NAME
-KEY_COLUMN_USAGE CONSTRAINT_SCHEMA
-PARTITIONS TABLE_SCHEMA
-PLUGINS PLUGIN_NAME
-PROCESSLIST ID
-PROFILING QUERY_ID
-REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA
-ROUTINES ROUTINE_SCHEMA
-SCHEMATA SCHEMA_NAME
-SCHEMA_PRIVILEGES TABLE_SCHEMA
-SESSION_STATUS VARIABLE_NAME
-SESSION_VARIABLES VARIABLE_NAME
-STATISTICS TABLE_SCHEMA
-TABLES TABLE_SCHEMA
-TABLE_CONSTRAINTS CONSTRAINT_SCHEMA
-TABLE_PRIVILEGES TABLE_SCHEMA
-TRIGGERS TRIGGER_SCHEMA
-USER_PRIVILEGES GRANTEE
-VIEWS TABLE_SCHEMA
SELECT MAX(table_name) FROM information_schema.tables WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test');
MAX(table_name)
VIEWS
@@ -1557,7 +1470,7 @@ CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_P
SELECT * FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME = 'test';
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
-NULL test latin1 latin1_swedish_ci NULL
+def test latin1 latin1_swedish_ci NULL
select count(*) from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='mysql' AND TABLE_NAME='nonexisting';
count(*)
0
@@ -1575,7 +1488,7 @@ AS SELECT *
FROM information_schema.tables;
SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS where TABLE_NAME = 'v1';
VIEW_DEFINITION
-select `tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`tables`.`TABLE_NAME` AS `TABLE_NAME`,`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`tables`.`ENGINE` AS `ENGINE`,`tables`.`VERSION` AS `VERSION`,`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`tables`.`DATA_FREE` AS `DATA_FREE`,`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`tables`.`CREATE_TIME` AS `CREATE_TIME`,`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`tables`.`CHECK_TIME` AS `CHECK_TIME`,`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`tables`.`CHECKSUM` AS `CHECKSUM`,`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables`
+select `information_schema`.`tables`.`TABLE_CATALOG` AS `TABLE_CATALOG`,`information_schema`.`tables`.`TABLE_SCHEMA` AS `TABLE_SCHEMA`,`information_schema`.`tables`.`TABLE_NAME` AS `TABLE_NAME`,`information_schema`.`tables`.`TABLE_TYPE` AS `TABLE_TYPE`,`information_schema`.`tables`.`ENGINE` AS `ENGINE`,`information_schema`.`tables`.`VERSION` AS `VERSION`,`information_schema`.`tables`.`ROW_FORMAT` AS `ROW_FORMAT`,`information_schema`.`tables`.`TABLE_ROWS` AS `TABLE_ROWS`,`information_schema`.`tables`.`AVG_ROW_LENGTH` AS `AVG_ROW_LENGTH`,`information_schema`.`tables`.`DATA_LENGTH` AS `DATA_LENGTH`,`information_schema`.`tables`.`MAX_DATA_LENGTH` AS `MAX_DATA_LENGTH`,`information_schema`.`tables`.`INDEX_LENGTH` AS `INDEX_LENGTH`,`information_schema`.`tables`.`DATA_FREE` AS `DATA_FREE`,`information_schema`.`tables`.`AUTO_INCREMENT` AS `AUTO_INCREMENT`,`information_schema`.`tables`.`CREATE_TIME` AS `CREATE_TIME`,`information_schema`.`tables`.`UPDATE_TIME` AS `UPDATE_TIME`,`information_schema`.`tables`.`CHECK_TIME` AS `CHECK_TIME`,`information_schema`.`tables`.`TABLE_COLLATION` AS `TABLE_COLLATION`,`information_schema`.`tables`.`CHECKSUM` AS `CHECKSUM`,`information_schema`.`tables`.`CREATE_OPTIONS` AS `CREATE_OPTIONS`,`information_schema`.`tables`.`TABLE_COMMENT` AS `TABLE_COMMENT` from `information_schema`.`tables`
DROP VIEW v1;
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME ='information_schema';
@@ -1731,3 +1644,66 @@ TEST_RESULT
OK
SET TIMESTAMP=DEFAULT;
End of 5.1 tests.
+create table information_schema.t1 (f1 INT);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+drop table information_schema.t1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+drop temporary table if exists information_schema.t1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create temporary table information_schema.t1 (f1 INT);
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+drop view information_schema.v1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create view information_schema.v1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create trigger mysql.trg1 after insert on information_schema.t1 for each row set @a=1;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+create table t1 select * from information_schema.t1;
+ERROR 42S02: Unknown table 't1' in information_schema
+CREATE TABLE t1(f1 char(100));
+REPAIR TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+CHECKSUM TABLE t1, information_schema.tables;
+Table Checksum
+test.t1 0
+information_schema.tables 0
+ANALYZE TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+CHECK TABLE t1, information_schema.tables;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+information_schema.tables check note The storage engine for the table doesn't support check
+OPTIMIZE TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+RENAME TABLE v1 to v2, information_schema.tables to t2;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE t1, information_schema.tables;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+LOCK TABLES t1 READ, information_schema.tables READ;
+ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
+DROP TABLE t1;
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE KEY_COLUMN_USAGE ALL NULL NULL NULL NULL NULL Open_full_table; Scanned all databases
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME='t1';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE PARTITIONS ALL NULL TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 1 database
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS
+WHERE CONSTRAINT_SCHEMA='test';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE REFERENTIAL_CONSTRAINTS ALL NULL CONSTRAINT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
+WHERE TABLE_NAME='t1' and TABLE_SCHEMA='test';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE TABLE_CONSTRAINTS ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Using where; Open_full_table; Scanned 0 databases
+EXPLAIN SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
+WHERE EVENT_OBJECT_SCHEMA='test';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE TRIGGERS ALL NULL EVENT_OBJECT_SCHEMA NULL NULL NULL Using where; Open_full_table; Scanned 1 database
+SELECT *
+FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
+LEFT JOIN INFORMATION_SCHEMA.COLUMNS
+USING (TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME)
+WHERE COLUMNS.TABLE_SCHEMA = 'test'
+AND COLUMNS.TABLE_NAME = 't1';
+TABLE_SCHEMA TABLE_NAME COLUMN_NAME CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME TABLE_CATALOG ORDINAL_POSITION COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index 5fa38f93993..bed73d9faf7 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -3,7 +3,7 @@ drop view if exists v1,v2;
drop function if exists f1;
drop function if exists f2;
use INFORMATION_SCHEMA;
-show tables where Tables_in_information_schema not like "Innodb%";
+show tables where Tables_in_information_schema NOT LIKE 'Innodb%';
Tables_in_information_schema
CHARACTER_SETS
COLLATIONS
@@ -119,12 +119,12 @@ create table t1 (f1 char(4));
create view v1 as select f1 from t1;
grant insert on v1 to testdb_2@localhost;
create view v5 as select f1 from t1;
-grant show view on v5 to testdb_2@localhost;
+grant select, show view on v5 to testdb_2@localhost;
create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
use testdb_1;
create view v6 as select f1 from t1;
-grant show view on v6 to testdb_2@localhost;
+grant select, show view on v6 to testdb_2@localhost;
create table t2 (f1 char(4));
create definer=`no_such_user`@`no_such_host` view v7 as select * from t2;
Warnings:
@@ -152,11 +152,13 @@ create view v2 as select f1 from testdb_1.v1;
create view v4 as select f1,f2 from testdb_1.v3;
show fields from testdb_1.v5;
Field Type Null Key Default Extra
+f1 char(4) YES NULL
show create view testdb_1.v5;
View Create View character_set_client collation_connection
v5 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_1`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v5` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci
show fields from testdb_1.v6;
Field Type Null Key Default Extra
+f1 char(4) YES NULL
show create view testdb_1.v6;
View Create View character_set_client collation_connection
v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci
@@ -171,9 +173,9 @@ v7 CREATE ALGORITHM=UNDEFINED DEFINER=`no_such_user`@`no_such_host` SQL SECURITY
Warnings:
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
revoke insert(f1) on v3 from testdb_2@localhost;
-revoke show view on v5 from testdb_2@localhost;
+revoke select,show view on v5 from testdb_2@localhost;
use testdb_1;
-revoke show view on v6 from testdb_2@localhost;
+revoke select,show view on v6 from testdb_2@localhost;
show fields from testdb_1.v5;
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5'
show create view testdb_1.v5;
@@ -203,7 +205,7 @@ show create view v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`testdb_2`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v1`.`f1` AS `f1` from `testdb_1`.`v1` latin1 latin1_swedish_ci
show create view testdb_1.v1;
-ERROR 42000: SHOW VIEW command denied to user 'testdb_2'@'localhost' for table 'v1'
+ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v1'
select table_name from information_schema.columns a
where a.table_name = 'v2';
table_name
diff --git a/mysql-test/r/information_schema_inno.result b/mysql-test/r/information_schema_inno.result
index 4f36fd2b8b5..fbb7e7e8397 100644
--- a/mysql-test/r/information_schema_inno.result
+++ b/mysql-test/r/information_schema_inno.result
@@ -8,22 +8,22 @@ FOREIGN KEY (id, t2_id) REFERENCES t2(t1_id, id) ON DELETE CASCADE) ENGINE=INNO
select * from information_schema.TABLE_CONSTRAINTS where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-NULL test PRIMARY test t1 PRIMARY KEY
-NULL test PRIMARY test t2 PRIMARY KEY
-NULL test t2_ibfk_1 test t2 FOREIGN KEY
-NULL test t2_ibfk_2 test t2 FOREIGN KEY
-NULL test PRIMARY test t3 PRIMARY KEY
-NULL test t3_ibfk_1 test t3 FOREIGN KEY
+def test PRIMARY test t1 PRIMARY KEY
+def test PRIMARY test t2 PRIMARY KEY
+def test t2_ibfk_1 test t2 FOREIGN KEY
+def test t2_ibfk_2 test t2 FOREIGN KEY
+def test PRIMARY test t3 PRIMARY KEY
+def test t3_ibfk_1 test t3 FOREIGN KEY
select * from information_schema.KEY_COLUMN_USAGE where
TABLE_SCHEMA= "test";
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
-NULL test PRIMARY NULL test t1 id 1 NULL NULL NULL NULL
-NULL test PRIMARY NULL test t2 id 1 NULL NULL NULL NULL
-NULL test t2_ibfk_1 NULL test t2 t1_id 1 1 test t1 id
-NULL test t2_ibfk_2 NULL test t2 t1_id 1 1 test t1 id
-NULL test PRIMARY NULL test t3 id 1 NULL NULL NULL NULL
-NULL test t3_ibfk_1 NULL test t3 id 1 1 test t2 t1_id
-NULL test t3_ibfk_1 NULL test t3 t2_id 2 2 test t2 id
+def test PRIMARY def test t1 id 1 NULL NULL NULL NULL
+def test PRIMARY def test t2 id 1 NULL NULL NULL NULL
+def test t2_ibfk_1 def test t2 t1_id 1 1 test t1 id
+def test t2_ibfk_2 def test t2 t1_id 1 1 test t1 id
+def test PRIMARY def test t3 id 1 NULL NULL NULL NULL
+def test t3_ibfk_1 def test t3 id 1 1 test t2 t1_id
+def test t3_ibfk_1 def test t3 t2_id 2 2 test t2 id
drop table t3, t2, t1;
CREATE TABLE t1(a1 INT NOT NULL, a2 INT NOT NULL,
PRIMARY KEY(a1, a2)) ENGINE=INNODB;
diff --git a/mysql-test/r/information_schema_part.result b/mysql-test/r/information_schema_part.result
index 04dc9ccf2c0..11c57ceb2c2 100644
--- a/mysql-test/r/information_schema_part.result
+++ b/mysql-test/r/information_schema_part.result
@@ -7,9 +7,9 @@ partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
select * from information_schema.partitions where table_schema="test"
and table_name="t1";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 x1 NULL 1 NULL LIST NULL b*a NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1
-NULL test t1 x2 NULL 2 NULL LIST NULL b*a NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2
-NULL test t1 x3 NULL 3 NULL LIST NULL b*a NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3
+def test t1 x1 NULL 1 NULL LIST NULL b*a NULL 1 0 0 0 # 1024 0 # # NULL NULL default ts1
+def test t1 x2 NULL 2 NULL LIST NULL b*a NULL 3,11,5,7 0 0 0 # 1024 0 # # NULL NULL default ts2
+def test t1 x3 NULL 3 NULL LIST NULL b*a NULL 16,8,24,27 0 0 0 # 1024 0 # # NULL NULL default ts3
create table t2 (a int not null,b int not null,c int not null, primary key(a,b))
partition by range (a)
partitions 3
@@ -19,27 +19,27 @@ partition x3 values less than maxvalue tablespace ts3);
select * from information_schema.partitions where table_schema="test"
and table_name="t2";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t2 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1
-NULL test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2
-NULL test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3
+def test t2 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 0 # 1024 0 # # NULL NULL default ts1
+def test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 0 # 1024 0 # # NULL NULL default ts2
+def test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 0 # 1024 0 # # NULL NULL default ts3
create table t3 (f1 date)
partition by hash(month(f1))
partitions 3;
select * from information_schema.partitions where table_schema="test"
and table_name="t3";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t3 p0 NULL 1 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t3 p1 NULL 2 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t3 p2 NULL 3 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t3 p0 NULL 1 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t3 p1 NULL 2 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t3 p2 NULL 3 NULL HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
create table t4 (f1 date, f2 int)
partition by key(f1,f2)
partitions 3;
select * from information_schema.partitions where table_schema="test"
and table_name="t4";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t4 p0 NULL 1 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t4 p1 NULL 2 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t4 p2 NULL 3 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t4 p0 NULL 1 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t4 p1 NULL 2 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t4 p2 NULL 3 NULL KEY NULL f1,f2 NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
drop table t1,t2,t3,t4;
create table t1 (a int not null,b int not null,c int not null,primary key (a,b))
partition by range (a)
@@ -63,14 +63,14 @@ subpartition x22 tablespace t2)
);
select * from information_schema.partitions where table_schema="test";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t2
-NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t2
-NULL test t2 x1 x11 1 1 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t2 x1 x12 1 2 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t2
-NULL test t2 x2 x21 2 1 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t1
-NULL test t2 x2 x22 2 2 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t2 x1 x11 1 1 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t2 x1 x12 1 2 RANGE KEY a a 1 0 0 0 # 1024 0 # # NULL NULL default t2
+def test t2 x2 x21 2 1 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t1
+def test t2 x2 x22 2 2 RANGE KEY a a 5 0 0 0 # 1024 0 # # NULL NULL default t2
drop table t1,t2;
create table t1 (
a int not null,
@@ -88,10 +88,10 @@ subpartition x22 tablespace t2 nodegroup 1)
);
select * from information_schema.partitions where table_schema="test";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 0 t1
-NULL test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 1 t2
-NULL test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 0 t1
-NULL test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 1 t2
+def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 0 t1
+def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 0 # 1024 0 # # NULL NULL 1 t2
+def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 0 t1
+def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 0 # 1024 0 # # NULL NULL 1 t2
show tables;
Tables_in_test
t1
@@ -99,7 +99,7 @@ drop table t1;
create table t1(f1 int, f2 int);
select * from information_schema.partitions where table_schema="test";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL 0 0 0 # 1024 0 # # NULL NULL NULL
+def test t1 NULL NULL NULL NULL NULL NULL NULL NULL NULL 0 0 0 # 1024 0 # # NULL NULL NULL
drop table t1;
create table t1 (f1 date)
partition by linear hash(month(f1))
@@ -107,9 +107,9 @@ partitions 3;
select * from information_schema.partitions where table_schema="test"
and table_name="t1";
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
-NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
-NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
+def test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default NULL
drop table t1;
create table t1 (a int)
PARTITION BY RANGE (a)
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 04d5ee99789..7208c529e89 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -2723,7 +2723,7 @@ create table t3 (s1 varchar(2) binary,primary key (s1)) engine=innodb;
create table t4 (s1 char(2) binary,primary key (s1)) engine=innodb;
insert into t1 values (0x41),(0x4120),(0x4100);
insert into t2 values (0x41),(0x4120),(0x4100);
-ERROR 23000: Duplicate entry 'A' for key 'PRIMARY'
+ERROR 23000: Duplicate entry 'A\x00' for key 'PRIMARY'
insert into t2 values (0x41),(0x4120);
insert into t3 values (0x41),(0x4120),(0x4100);
ERROR 23000: Duplicate entry 'A ' for key 'PRIMARY'
diff --git a/mysql-test/r/innodb_mysql.result b/mysql-test/r/innodb_mysql.result
index 402ab3c1b16..76ff2cfc0f3 100644
--- a/mysql-test/r/innodb_mysql.result
+++ b/mysql-test/r/innodb_mysql.result
@@ -2274,3 +2274,23 @@ DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1,t2;
End of 5.1 tests
+#
+# Test for bug #39932 "create table fails if column for FK is in different
+# case than in corr index".
+#
+drop tables if exists t1, t2;
+create table t1 (pk int primary key) engine=InnoDB;
+# Even although the below statement uses uppercased field names in
+# foreign key definition it still should be able to find explicitly
+# created supporting index. So it should succeed and should not
+# create any additional supporting indexes.
+create table t2 (fk int, key x (fk),
+constraint x foreign key (FK) references t1 (PK)) engine=InnoDB;
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `fk` int(11) DEFAULT NULL,
+ KEY `x` (`fk`),
+ CONSTRAINT `x` FOREIGN KEY (`fk`) REFERENCES `t1` (`pk`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+drop table t2, t1;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 3f91039d592..36d2b9ef348 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -355,17 +355,17 @@ insert into t2 values (1,12), (2,24);
insert into v1 (f1) values (3) on duplicate key update f3= f3 + 10;
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
+ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
select * from t1;
f1 f2
1 11
2 22
-3 NULL
insert into v1 (f1) values (3) on duplicate key update f1= f3 + 10;
+ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
select * from t1;
f1 f2
1 11
2 22
-12 NULL
drop view v1;
drop table t1,t2;
create table t1 (id int primary key auto_increment, data int, unique(data));
@@ -639,3 +639,43 @@ CREATE TABLE t2(f1 CHAR(1));
INSERT INTO t2 SELECT f1 FROM t1;
DROP TABLE t1, t2;
End of 5.0 tests.
+#
+# Bug#34898 "mysql_info() reports 0 warnings while
+# mysql_warning_count() reports 1"
+# Check that the number of warnings reported by
+# mysql_info() is correct.
+#
+drop table if exists t1;
+create table t1 (data varchar(4) not null);
+set sql_mode='error_for_division_by_zero';
+#
+# Demonstrate that the number of warnings matches
+# the information in mysql_info().
+#
+insert t1 (data) values ('letter'), (1/0);
+affected rows: 2
+info: Records: 2 Duplicates: 0 Warnings: 3
+Warnings:
+Warning 1265 Data truncated for column 'data' at row 1
+Warning 1365 Division by 0
+Warning 1048 Column 'data' cannot be null
+update t1 set data='envelope' where 1/0 or 1;
+affected rows: 2
+info: Rows matched: 2 Changed: 2 Warnings: 3
+Warnings:
+Warning 1365 Division by 0
+Warning 1265 Data truncated for column 'data' at row 1
+Warning 1265 Data truncated for column 'data' at row 2
+insert t1 (data) values (default), (1/0), ('dead beef');
+affected rows: 3
+info: Records: 3 Duplicates: 0 Warnings: 4
+Warnings:
+Warning 1364 Field 'data' doesn't have a default value
+Warning 1365 Division by 0
+Warning 1048 Column 'data' cannot be null
+Warning 1265 Data truncated for column 'data' at row 3
+set sql_mode=default;
+drop table t1;
+#
+# End of 5.4 tests
+#
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index baabf48cb2f..d443e20df76 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -752,8 +752,8 @@ statistics.TABLE_NAME, statistics.COLUMN_NAME, statistics.TABLE_CATALOG, statist
columns.TABLE_CATALOG, columns.TABLE_SCHEMA, columns.COLUMN_DEFAULT, columns.IS_NULLABLE, columns.DATA_TYPE, columns.CHARACTER_MAXIMUM_LENGTH, columns.CHARACTER_OCTET_LENGTH, columns.NUMERIC_PRECISION, columns.NUMERIC_SCALE, columns.CHARACTER_SET_NAME, columns.COLLATION_NAME, columns.COLUMN_TYPE, columns.COLUMN_KEY, columns.EXTRA, columns.COLUMN_COMMENT
from information_schema.statistics join information_schema.columns using(table_name,column_name) where table_name='user';
TABLE_NAME COLUMN_NAME TABLE_CATALOG TABLE_SCHEMA NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLLATION SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT TABLE_CATALOG TABLE_SCHEMA COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA COLUMN_COMMENT
-user Host NULL mysql 0 mysql PRIMARY 1 A NULL NULL BTREE NULL mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
-user User NULL mysql 0 mysql PRIMARY 2 A NULL NULL BTREE NULL mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
+user Host def mysql 0 mysql PRIMARY 1 A NULL NULL BTREE def mysql NO char 60 180 NULL NULL utf8 utf8_bin char(60) PRI
+user User def mysql 0 mysql PRIMARY 2 A NULL NULL BTREE def mysql NO char 16 48 NULL NULL utf8 utf8_bin char(16) PRI
drop table t1;
drop table t2;
drop table t3;
diff --git a/mysql-test/r/join_optimizer.result b/mysql-test/r/join_optimizer.result
new file mode 100644
index 00000000000..9e667506cfa
--- /dev/null
+++ b/mysql-test/r/join_optimizer.result
@@ -0,0 +1,37 @@
+drop table if exists t0,t1,t2,t3;
+#
+# BUG#38049 incorrect rows estimations with references from preceding table
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a varchar(32));
+insert into t1 values ('owner'),('requester'),('admincc'),('cc');
+CREATE TABLE t2 (
+id int(11) NOT NULL,
+type varchar(32) default NULL,
+PRIMARY KEY (id)
+);
+insert into t2 values (1,'owner'), (2,'admincc');
+CREATE TABLE t3 (
+id int(11) NOT NULL,
+domain varchar(32) default NULL,
+type varchar(32) default NULL,
+PRIMARY KEY (id)
+);
+set @domain='system';
+set @pk=0;
+INSERT INTO t3 select @pk:=@pk+1, 'system', t1.a from t1;
+INSERT INTO t3 select @pk:=@pk+1, 'queue', t1.a from t1, t0 where t0.a<3;
+INSERT INTO t3 select @pk:=@pk+1, 'ticket', t1.a from t1, t0 A, t0 B, t0 C;
+CREATE INDEX groups_d ON t3(domain);
+CREATE INDEX groups_t ON t3(type);
+CREATE INDEX groups_td ON t3(type, domain);
+CREATE INDEX groups_dt ON t3(domain, type);
+For table g this must use ref(groups_dt) and #rows should be around 15 and not 335:
+explain
+SELECT STRAIGHT_JOIN g.id FROM t2 a, t3 g USE INDEX(groups_dt)
+WHERE g.domain = 'queue' AND g.type = a.type;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE a ALL NULL NULL NULL NULL 2
+1 SIMPLE g ref groups_dt groups_dt 70 const,test.a.type 13 Using where
+drop table t0,t1,t2,t3;
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 1e4fc91b8bd..bc77072f67a 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -942,25 +942,29 @@ group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by t1.a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 left join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
select group_concat(t1.b,t2.c) from t1 inner join t2 using(a) group by a;
group_concat(t1.b,t2.c)
aaaaa
bbbbb
Warnings:
-Warning 1260 2 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
+Warning 1260 Row 2 was cut by GROUP_CONCAT()
drop table t1, t2;
set group_concat_max_len=default;
create table t1 (gid smallint(5) unsigned not null, x int(11) not null, y int(11) not null, art int(11) not null, primary key (gid,x,y));
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index fcc09a0244d..21fcfceff81 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -251,13 +251,13 @@ insert t1 values ('cccc', 'tttt'),
(0xD0B1212223D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1212223D0B1D0B1D0B1D0B1),
(0xD0B1222123D0B1D0B1D0B1D0B1D0B1, 0xD0B1D0B1222123D0B1D0B1D0B1D0B1);
insert t1 (c) values ('cc22');
-ERROR 23000: Duplicate entry 'cc22' for key 'c'
+ERROR 23000: Duplicate entry 'cc' for key 'c'
insert t1 (t) values ('ttt22');
-ERROR 23000: Duplicate entry 'ttt22' for key 't'
+ERROR 23000: Duplicate entry 'ttt' for key 't'
insert t1 (c) values (0xD0B1212322D0B1D0B1D0B1D0B1D0B1);
-ERROR 23000: Duplicate entry 'б!#"Ð' for key 'c'
+ERROR 23000: Duplicate entry '\0431!' for key 'c'
insert t1 (t) values (0xD0B1D0B1212322D0B1D0B1D0B1D0B1);
-ERROR 23000: Duplicate entry 'бб!#"б' for key 't'
+ERROR 23000: Duplicate entry '\0431\0431!' for key 't'
select c from t1 where c='cccc';
c
cccc
diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result
new file mode 100644
index 00000000000..55e6759748a
--- /dev/null
+++ b/mysql-test/r/loadxml.result
@@ -0,0 +1,75 @@
+drop table if exists t1, t2;
+create table t1 (a int, b varchar(64));
+-- Load a static XML file
+load xml infile '../../std_data/loadxml.dat' into table t1
+rows identified by '<row>';
+select * from t1 order by a;
+a b
+1 b1
+2 b2
+3 b3
+11 b11
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+delete from t1;
+-- Load a static XML file with 'IGNORE num ROWS'
+load xml infile '../../std_data/loadxml.dat' into table t1
+rows identified by '<row>' ignore 4 rows;
+select * from t1 order by a;
+a b
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+-- Check 'mysqldump --xml' + 'LOAD XML' round trip
+delete from t1;
+load xml infile 'MYSQLTEST_VARDIR/tmp/loadxml-dump.xml' into table t1 rows identified by '<row>';;
+select * from t1 order by a;
+a b
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+--Check that default row tag is '<row>
+delete from t1;
+load xml infile 'MYSQLTEST_VARDIR/tmp/loadxml-dump.xml' into table t1;;
+select * from t1 order by a;
+a b
+111 b111
+112 b112 & < > " ' &unknown; -- check entities
+212 b212
+213 b213
+214 b214
+215 b215
+216 &bb b;
+-- Check that 'xml' is not a keyword
+select 1 as xml;
+xml
+1
+create table t2(fl text);
+LOAD XML LOCAL INFILE "MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>';;
+drop table t1;
+drop table t2;
+create table t1 (
+id int(11) not null,
+text text,
+primary key (id)
+) engine=MyISAM default charset=latin1;
+load xml infile '../../std_data/loadxml2.dat' into table t1;
+select * from t1;
+id text
+1 line1
+line2
+line3
+drop table t1;
diff --git a/mysql-test/r/locale.result b/mysql-test/r/locale.result
index 89883b070d2..af7f9e3c132 100644
--- a/mysql-test/r/locale.result
+++ b/mysql-test/r/locale.result
@@ -1,6 +1,69 @@
DROP TABLE IF EXISTS t1;
Start of 5.4 tests
#
+# WL#4642 Greek locale for DAYNAME, MONTHNAME, DATE_FORMAT
+#
+SET NAMES utf8;
+SET @@lc_time_names=109;
+SELECT @@lc_time_names;
+@@lc_time_names
+el_GR
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES
+('2006-01-01'),('2006-01-02'),('2006-01-03'),
+('2006-01-04'),('2006-01-05'),('2006-01-06'),('2006-01-07');
+SELECT a, date_format(a,'%a') as abday, dayname(a) as day FROM t1 ORDER BY a;
+a abday day
+2006-01-01 Κυρ Κυριακή
+2006-01-02 Δευ Δευτέρα
+2006-01-03 ΀ρί ΀ρίτη
+2006-01-04 ΀ετ ΀ετάρτη
+2006-01-05 ΠέΌ ΠέΌπτη
+2006-01-06 Παρ Παρασκευή
+2006-01-07 Σάβ Σάββατο
+DROP TABLE t1;
+CREATE TABLE t1 (a DATE);
+INSERT INTO t1 VALUES
+('2006-01-01'),('2006-02-01'),('2006-03-01'),
+('2006-04-01'),('2006-05-01'),('2006-06-01'),
+('2006-07-01'),('2006-08-01'),('2006-09-01'),
+('2006-10-01'),('2006-11-01'),('2006-12-01');
+SELECT a, date_format(a,'%b') as abmon, monthname(a) as mon FROM t1 ORDER BY a;
+a abmon mon
+2006-01-01 ΙαΜ ΙαΜουάριος
+2006-02-01 Ίεβ Ίεβρουάριος
+2006-03-01 Μάρ Μάρτιος
+2006-04-01 Απρ Απρίλιος
+2006-05-01 Μάι Μάιος
+2006-06-01 ΙούΜ ΙούΜιος
+2006-07-01 Ιούλ Ιούλιος
+2006-08-01 Αύγ Αύγουστος
+2006-09-01 Σεπ ΣεπτέΌβριος
+2006-10-01 Οκτ Οκτώβριος
+2006-11-01 Νοέ ΝοέΌβριος
+2006-12-01 Δεκ ΔεκέΌβριος
+SELECT format(123456.789, 3, 'el_GR');
+format(123456.789, 3, 'el_GR')
+123456.789
+DROP TABLE t1;
+#
+# Bug#46633 Obsolete Serbian locale name
+#
+SET lc_messages=sr_YU;
+Warnings:
+Warning 1287 'sr_YU' is deprecated; use 'sr_RS' instead
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages sr_RS
+SET lc_messages=sr_RS;
+SHOW VARIABLES LIKE 'lc_messages';
+Variable_name Value
+lc_messages sr_RS
+SET lc_time_names=sr_RS;
+SELECT format(123456.789, 3, 'sr_RS');
+format(123456.789, 3, 'sr_RS')
+123456.789
+#
# Bug#43207 wrong LC_TIME names for romanian locale
#
SET NAMES utf8;
diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result
new file mode 100644
index 00000000000..fc4e8c850f6
--- /dev/null
+++ b/mysql-test/r/lock_sync.result
@@ -0,0 +1,66 @@
+#
+# Test for bug #45143 "All connections hang on concurrent ALTER TABLE".
+#
+# Concurrent execution of statements which required weak write lock
+# (TL_WRITE_ALLOW_WRITE) on several instances of the same table and
+# statements which tried to acquire stronger write lock (TL_WRITE,
+# TL_WRITE_ALLOW_READ) on this table might have led to deadlock.
+drop table if exists t1;
+# Create auxiliary connections used through the test.
+# Reset DEBUG_SYNC facility before using it.
+set debug_sync= 'RESET';
+# Turn off logging so calls to locking subsystem performed
+# for general_log table won't interfere with our test.
+set @old_general_log = @@global.general_log;
+set @@global.general_log= OFF;
+create table t1 (i int) engine=InnoDB;
+insert into t1 values (1);
+# Prepare user lock which will be used for resuming execution of
+# the first statement after it acquires TL_WRITE_ALLOW_WRITE lock.
+select get_lock("lock_bug45143_wait", 0);
+get_lock("lock_bug45143_wait", 0)
+1
+# Switch to connection 'con_bug45143_1'.
+# Sending:
+insert into t1 values (get_lock("lock_bug45143_wait", 100));;
+# Switch to connection 'con_bug45143_2'.
+# Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1'
+# and then gets blocked on user lock 'lock_bug45143_wait'.
+# Ensure that upcoming SELECT waits after acquiring TL_WRITE_ALLOW_WRITE
+# lock for the first instance of 't1'.
+set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
+# Sending:
+select count(*) > 0 from t1 as a, t1 as b for update;;
+# Switch to connection 'con_bug45143_3'.
+# Wait until the above SELECT ... FOR UPDATE is blocked after
+# acquiring lock for the the first instance of 't1'.
+set debug_sync= 'now WAIT_FOR parked';
+# Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1':
+lock table t1 write;;
+# Switch to connection 'default'.
+# Wait until this LOCK TABLES statement starts waiting for table lock.
+# Allow SELECT ... FOR UPDATE to resume.
+# Since it already has TL_WRITE_ALLOW_WRITE lock on the first instance
+# of 't1' it should be able to get lock on the second instance without
+# waiting, even although there is another thread which has such lock
+# on this table and also there is a thread waiting for a TL_WRITE on it.
+set debug_sync= 'now SIGNAL go';
+# Switch to connection 'con_bug45143_2'.
+# Reap SELECT ... FOR UPDATE
+count(*) > 0
+1
+# Switch to connection 'default'.
+# Resume execution of the INSERT statement.
+select release_lock("lock_bug45143_wait");
+release_lock("lock_bug45143_wait")
+1
+# Switch to connection 'con_bug45143_1'.
+# Reap INSERT statement.
+# Switch to connection 'con_bug45143_3'.
+# Reap LOCK TABLES statement.
+unlock tables;
+# Switch to connection 'default'.
+# Do clean-up.
+set debug_sync= 'RESET';
+set @@global.general_log= @old_general_log;
+drop table t1;
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 5c3e3d789a1..56e30ac59f8 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -309,6 +309,30 @@ SET @@global.general_log_file = @old_general_log_file;
SET @@global.slow_query_log = @old_slow_query_log;
SET @@global.slow_query_log_file = @old_slow_query_log_file;
End of 5.1 tests
+
+# --
+# -- Bug#38124: "general_log_file" variable silently unset when
+# -- using expression
+# --
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file INTO @my_glf;
+SET GLOBAL general_log_file = 'BUG38124.LOG';
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124.LOG
+SET GLOBAL general_log_file = concat('BUG38124-2.LOG');
+SELECT @@general_log_file;
+@@general_log_file
+BUG38124-2.LOG
+SET GLOBAL general_log_file = substr('BUG38124-2.LOG',3,6);
+SELECT @@general_log_file;
+@@general_log_file
+G38124
+SET GLOBAL general_log_file = DEFAULT;
+SELECT @@general_log_file = @my_glf;
+@@general_log_file = @my_glf
+1
+SET GLOBAL general_log_file = @old_general_log_file;
# Close connection con1
SET global general_log = @old_general_log;
SET global general_log_file = @old_general_log_file;
diff --git a/mysql-test/r/log_state_bug33693.result b/mysql-test/r/log_state_bug33693.result
new file mode 100644
index 00000000000..abf20fc7aa7
--- /dev/null
+++ b/mysql-test/r/log_state_bug33693.result
@@ -0,0 +1,3 @@
+SELECT INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run');;
+INSTR(@@general_log_file, 'MYSQLTEST_VARDIR/run')
+0
diff --git a/mysql-test/r/lowercase_fs_off.result b/mysql-test/r/lowercase_fs_off.result
index 4a59801692d..30f835a8ea3 100644
--- a/mysql-test/r/lowercase_fs_off.result
+++ b/mysql-test/r/lowercase_fs_off.result
@@ -22,8 +22,8 @@ f1
GRANT SELECT ON t1 to user_1@localhost;
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
-'user_1'@'localhost' NULL d1 T1 SELECT NO
-'user_1'@'localhost' NULL d1 t1 SELECT NO
+'user_1'@'localhost' def d1 T1 SELECT NO
+'user_1'@'localhost' def d1 t1 SELECT NO
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
DROP USER user_1@localhost;
DROP DATABASE d1;
diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result
index 51c2ac0faf5..cf87fd1b5a4 100644
--- a/mysql-test/r/lowercase_table2.result
+++ b/mysql-test/r/lowercase_table2.result
@@ -174,3 +174,74 @@ TABLE_SCHEMA TABLE_NAME
mysqltest_LC2 myUC
use test;
drop database mysqltest_LC2;
+# End of 5.1 tests
+#
+# Test for bug #44738 "fill_schema_table_from_frm() opens tables without
+# lowercasing table name". Due to not properly normalizing table names
+# in lower_case_table_names modes in this function queries to I_S which
+# were executed through it left entries with incorrect key in table
+# definition cache. As result further queries to I_S that used this
+# function produced stale results in cases when table definition was
+# changed by a DDL statement. Also combination of this issue and a
+# similar problem in CREATE TABLE (it also has peeked into table
+# definition cache using non-normalized key) led to spurious
+# ER_TABLE_EXISTS_ERROR errors when one tried to create table with the
+# same name as a previously existing but dropped table.
+#
+drop database if exists mysqltest_UPPERCASE;
+drop table if exists t_bug44738_UPPERCASE;
+create database mysqltest_UPPERCASE;
+use mysqltest_UPPERCASE;
+create table t_bug44738_UPPERCASE (i int) comment='Old comment';
+create table t_bug44738_lowercase (i int) comment='Old comment';
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%'
+ order by table_name;
+table_schema table_name table_comment
+mysqltest_UPPERCASE t_bug44738_lowercase Old comment
+mysqltest_UPPERCASE t_bug44738_UPPERCASE Old comment
+alter table t_bug44738_UPPERCASE comment='New comment';
+alter table t_bug44738_lowercase comment='New comment';
+# There should be no stale entries in TDC for our tables after the
+# above ALTER TABLE statements so new version of comments should be
+# returned by the below query to I_S.
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema like 'mysqltest_%' and table_name like 't_bug44738_%'
+ order by table_name;
+table_schema table_name table_comment
+mysqltest_UPPERCASE t_bug44738_lowercase New comment
+mysqltest_UPPERCASE t_bug44738_UPPERCASE New comment
+drop database mysqltest_UPPERCASE;
+use test;
+# Let us check that the original test case which led to discovery
+# of this problem also works.
+create table t_bug44738_UPPERCASE (i int);
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema table_name table_comment
+test t_bug44738_UPPERCASE
+drop table t_bug44738_UPPERCASE;
+# After the above DROP TABLE there are no entries in TDC which correspond
+# to our table and therefore the below statement should succeed.
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
+# Finally, let us check that another issue which was exposed by
+# the original test case is solved. I.e. that fuse in CREATE TABLE
+# which ensures that table is not created if there is an entry for
+# it in TDC even though it was removed from disk uses normalized
+# version of the table name.
+create table t_bug44738_UPPERCASE (i int) engine = myisam;
+# Load table definition in TDC.
+select table_schema, table_name, table_comment from information_schema.tables
+where table_schema = 'test' and table_name like 't_bug44738_%';
+table_schema table_name table_comment
+test t_bug44738_UPPERCASE
+# Simulate manual removal of the table.
+# After manual removal of table still there should be an entry for table
+# in TDC so attempt to create table with the same name should fail.
+create table t_bug44738_UPPERCASE (i int);
+ERROR 42S01: Table 't_bug44738_uppercase' already exists
+# And should succeed after FLUSH TABLES.
+flush tables;
+create table t_bug44738_UPPERCASE (i int);
+drop table t_bug44738_UPPERCASE;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 893ea5acf88..83152a0dd8d 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -914,7 +914,7 @@ SELECT * FROM tm1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
CHECK TABLE tm1;
Table Op Msg_type Msg_text
-test.tm1 check Error Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
+test.tm1 check Warning Table 'test.t2' is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
test.tm1 check error Corrupt
ALTER TABLE t2 MODIFY a INT;
@@ -2023,7 +2023,7 @@ CREATE TABLE tm1 (c1 INT) ENGINE=MRG_MYISAM UNION=(t1) INSERT_METHOD=FIRST;
SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE
TABLE_SCHEMA = 'test' and TABLE_NAME='tm1';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
-NULL test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
+def test tm1 BASE TABLE NULL NULL NULL # # # # # # # # # # NULL # # Unable to open underlying table which is differently defined or of non-MyISAM ty
DROP TABLE tm1;
CREATE TABLE t1(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
CREATE TABLE t2(C1 INT, C2 INT, KEY C1(C1), KEY C2(C2)) ENGINE=MYISAM;
@@ -2220,3 +2220,39 @@ tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH R
DROP TRIGGER tr1;
DROP TABLE t1, t2, t3;
End of 5.1 tests
+#
+# An additional test case for Bug#27430 Crash in subquery code
+# when in PS and table DDL changed after PREPARE
+#
+# Test merge table with too many merge children.
+#
+drop table if exists t_parent;
+set @save_table_definition_cache=@@global.table_definition_cache;
+#
+# Set @@global.table_definition_cache to minimum
+#
+set @@global.table_definition_cache=400;
+set @a=null;
+#
+# Create 400 merge children
+#
+set @a=concat("create table t_parent (a int) union(", @a,
+") insert_method=first engine=mrg_myisam");
+prepare stmt from @a;
+execute stmt;
+prepare stmt from "select * from t_parent";
+execute stmt;
+ERROR HY000: Prepared statement needs to be re-prepared
+execute stmt;
+ERROR HY000: Prepared statement needs to be re-prepared
+execute stmt;
+ERROR HY000: Prepared statement needs to be re-prepared
+deallocate prepare stmt;
+#
+# Create merge parent
+#
+#
+# Cleanup
+#
+drop table t_parent;
+set @@global.table_definition_cache=@save_table_definition_cache;
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
index 6b498e55d85..58dd97ee9f3 100644
--- a/mysql-test/r/metadata.result
+++ b/mysql-test/r/metadata.result
@@ -2,7 +2,7 @@ drop table if exists t1,t2;
select 1, 1.0, -1, "hello", NULL;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def 1 8 1 1 N 32897 0 63
-def 1.0 246 4 3 N 129 1 63
+def 1.0 246 4 3 N 32897 1 63
def -1 8 2 2 N 32897 0 63
def hello 253 5 5 N 1 31 8
def NULL 6 0 0 Y 32896 0 63
@@ -18,7 +18,7 @@ def test t1 t1 d d 3 11 0 Y 32768 0 63
def test t1 t1 e e 8 20 0 Y 32768 0 63
def test t1 t1 f f 4 3 0 Y 32768 2 63
def test t1 t1 g g 5 4 0 Y 32768 3 63
-def test t1 t1 h h 246 7 0 Y 0 4 63
+def test t1 t1 h h 246 7 0 Y 32768 4 63
def test t1 t1 i i 13 4 0 Y 32864 0 63
def test t1 t1 j j 10 10 0 Y 128 0 63
def test t1 t1 k k 7 19 0 N 9441 0 63
@@ -199,3 +199,95 @@ def IFNULL(d, d) IFNULL(d, d) 10 10 10 Y 128 0 63
def LEAST(d, d) LEAST(d, d) 10 10 10 Y 128 0 63
DROP TABLE t1;
End of 5.0 tests
+create table t1(
+# numeric types
+bool_col bool,
+boolean_col boolean,
+bit_col bit(5),
+tiny tinyint,
+tiny_uns tinyint unsigned,
+small smallint,
+small_uns smallint unsigned,
+medium mediumint,
+medium_uns mediumint unsigned,
+int_col int,
+int_col_uns int unsigned,
+big bigint,
+big_uns bigint unsigned,
+decimal_col decimal(10,5),
+# synonyms of DECIMAL
+numeric_col numeric(10),
+fixed_col fixed(10),
+dec_col dec(10),
+decimal_col_uns decimal(10,5) unsigned,
+fcol float,
+fcol_uns float unsigned,
+dcol double,
+double_precision_col double precision,
+dcol_uns double unsigned,
+# date/time types
+date_col date,
+time_col time,
+timestamp_col timestamp,
+year_col year,
+datetime_col datetime,
+# string types
+char_col char(5),
+varchar_col varchar(10),
+binary_col binary(10),
+varbinary_col varbinary(10),
+tinyblob_col tinyblob,
+blob_col blob,
+mediumblob_col mediumblob,
+longblob_col longblob,
+text_col text,
+mediumtext_col mediumtext,
+longtext_col longtext,
+enum_col enum("A","B","C"),
+set_col set("F","E","D")
+);
+select * from t1;
+Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 bool_col bool_col 1 1 0 Y 32768 0 63
+def test t1 t1 boolean_col boolean_col 1 1 0 Y 32768 0 63
+def test t1 t1 bit_col bit_col 16 5 0 Y 32 0 63
+def test t1 t1 tiny tiny 1 4 0 Y 32768 0 63
+def test t1 t1 tiny_uns tiny_uns 1 3 0 Y 32800 0 63
+def test t1 t1 small small 2 6 0 Y 32768 0 63
+def test t1 t1 small_uns small_uns 2 5 0 Y 32800 0 63
+def test t1 t1 medium medium 9 9 0 Y 32768 0 63
+def test t1 t1 medium_uns medium_uns 9 8 0 Y 32800 0 63
+def test t1 t1 int_col int_col 3 11 0 Y 32768 0 63
+def test t1 t1 int_col_uns int_col_uns 3 10 0 Y 32800 0 63
+def test t1 t1 big big 8 20 0 Y 32768 0 63
+def test t1 t1 big_uns big_uns 8 20 0 Y 32800 0 63
+def test t1 t1 decimal_col decimal_col 246 12 0 Y 32768 5 63
+def test t1 t1 numeric_col numeric_col 246 11 0 Y 32768 0 63
+def test t1 t1 fixed_col fixed_col 246 11 0 Y 32768 0 63
+def test t1 t1 dec_col dec_col 246 11 0 Y 32768 0 63
+def test t1 t1 decimal_col_uns decimal_col_uns 246 11 0 Y 32800 5 63
+def test t1 t1 fcol fcol 4 12 0 Y 32768 31 63
+def test t1 t1 fcol_uns fcol_uns 4 12 0 Y 32800 31 63
+def test t1 t1 dcol dcol 5 22 0 Y 32768 31 63
+def test t1 t1 double_precision_col double_precision_col 5 22 0 Y 32768 31 63
+def test t1 t1 dcol_uns dcol_uns 5 22 0 Y 32800 31 63
+def test t1 t1 date_col date_col 10 10 0 Y 128 0 63
+def test t1 t1 time_col time_col 11 8 0 Y 128 0 63
+def test t1 t1 timestamp_col timestamp_col 7 19 0 N 9441 0 63
+def test t1 t1 year_col year_col 13 4 0 Y 32864 0 63
+def test t1 t1 datetime_col datetime_col 12 19 0 Y 128 0 63
+def test t1 t1 char_col char_col 254 5 0 Y 0 0 8
+def test t1 t1 varchar_col varchar_col 253 10 0 Y 0 0 8
+def test t1 t1 binary_col binary_col 254 10 0 Y 128 0 63
+def test t1 t1 varbinary_col varbinary_col 253 10 0 Y 128 0 63
+def test t1 t1 tinyblob_col tinyblob_col 252 255 0 Y 144 0 63
+def test t1 t1 blob_col blob_col 252 65535 0 Y 144 0 63
+def test t1 t1 mediumblob_col mediumblob_col 252 16777215 0 Y 144 0 63
+def test t1 t1 longblob_col longblob_col 252 4294967295 0 Y 144 0 63
+def test t1 t1 text_col text_col 252 65535 0 Y 16 0 8
+def test t1 t1 mediumtext_col mediumtext_col 252 16777215 0 Y 16 0 8
+def test t1 t1 longtext_col longtext_col 252 4294967295 0 Y 16 0 8
+def test t1 t1 enum_col enum_col 254 1 0 Y 256 0 8
+def test t1 t1 set_col set_col 254 5 0 Y 2048 0 8
+bool_col boolean_col bit_col tiny tiny_uns small small_uns medium medium_uns int_col int_col_uns big big_uns decimal_col numeric_col fixed_col dec_col decimal_col_uns fcol fcol_uns dcol double_precision_col dcol_uns date_col time_col timestamp_col year_col datetime_col char_col varchar_col binary_col varbinary_col tinyblob_col blob_col mediumblob_col longblob_col text_col mediumtext_col longtext_col enum_col set_col
+drop table t1;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index 449333a4ae6..4f22029814c 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -604,7 +604,7 @@ a b
4 4
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 206
+master-bin.000001 207
delete from t1;
delete from t2;
insert into t1 values (1,2),(3,4),(4,4);
@@ -614,7 +614,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a;
ERROR 23000: Duplicate entry '4' for key 'PRIMARY'
show master status /* there must be the UPDATE query event */;
File Position Binlog_Do_DB Binlog_Ignore_DB
-master-bin.000001 221
+master-bin.000001 222
drop table t1, t2;
set @@session.binlog_format= @sav_binlog_format;
drop table if exists t1, t2, t3;
diff --git a/mysql-test/r/myisam-system.result b/mysql-test/r/myisam-system.result
index e0629d955ae..b3ba8066f5c 100644
--- a/mysql-test/r/myisam-system.result
+++ b/mysql-test/r/myisam-system.result
@@ -2,7 +2,7 @@ drop table if exists t1,t2;
create table t1 (a int) engine=myisam;
drop table if exists t1;
Warnings:
-Error 2 Can't find file: 't1' (errno: 2)
+Warning 2 Can't find file: 't1' (errno: 2)
create table t1 (a int) engine=myisam;
drop table t1;
Got one of the listed errors
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 5c6a0e2f93d..8debb3a9414 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -207,6 +207,8 @@ Warning (Code 1286): Unknown table engine 'nonexistent2'
Warning (Code 1266): Using storage engine MyISAM for table 't2'
Error (Code 1050): Table 't2' already exists
drop tables t1, t2;
+Variable_name Value
+lc_messages ru_RU
<TABLE BORDER=1><TR><TH>&lt;</TH></TR><TR><TD>&lt; &amp; &gt;</TD></TR></TABLE>create table t1 (a char(5));
insert into t1 values ('\0b\0');
a
diff --git a/mysql-test/r/mysql_locale_posix.result b/mysql-test/r/mysql_locale_posix.result
new file mode 100644
index 00000000000..72a473bb89e
--- /dev/null
+++ b/mysql-test/r/mysql_locale_posix.result
@@ -0,0 +1,72 @@
+SET NAMES utf8;
+DROP DATABASE IF EXISTS `ó`;
+DROP DATABASE IF EXISTS `Ăł`;
+DROP DATABASE IF EXISTS `цЁ`;
+DROP DATABASE IF EXISTS `ó`;
+
+iso88591
+@@character_set_client
+latin1
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+
+iso88592
+@@character_set_client
+latin2
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+
+koi8r
+@@character_set_client
+koi8r
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+
+utf8
+@@character_set_client
+utf8
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+Database: ó
++--------+
+| Tables |
++--------+
++--------+
+Database: Ăł
++--------+
+| Tables |
++--------+
++--------+
+Database: цЁ
++--------+
+| Tables |
++--------+
++--------+
+SHOW DATABASES LIKE 'ó';
+Database (ó)
+ó
+SHOW DATABASES LIKE 'Ăł';
+Database (Ăł)
+Ăł
+SHOW DATABASES LIKE 'цЁ';
+Database (цЁ)
+цЁ
+SHOW DATABASES LIKE 'ó';
+Database (ó)
+ó
+DROP DATABASE `ó`;
+DROP DATABASE `Ăł`;
+DROP DATABASE `цЁ`;
+DROP DATABASE `ó`;
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index 384442f8c31..b96b579d9b5 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -127,3 +127,4 @@ mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
set GLOBAL sql_mode=default;
+The --upgrade-system-tables option was used, databases won't be touched.
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 5f1a0565b10..89f7e1dab95 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -162,8 +162,8 @@ CREATE TABLE t1 (a INT);
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA="#mysql50#a@b" ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL #mysql50#a@b tr1 INSERT NULL #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-NULL #mysql50#a@b tr2 INSERT NULL #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def #mysql50#a@b tr1 INSERT def #mysql50#a@b #mysql50#c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def #mysql50#a@b tr2 INSERT def #mysql50#a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
Warnings:
Warning 1603 Triggers for table `#mysql50#a@b`.`#mysql50#c@d` have no creation context
Warning 1603 Triggers for table `#mysql50#a@b`.`t1` have no creation context
@@ -172,8 +172,8 @@ USE `a@b`;
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS
WHERE TRIGGER_SCHEMA="a@b" ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL a@b tr1 INSERT NULL a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
-NULL a@b tr2 INSERT NULL a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+def a@b tr1 INSERT def a@b c@d 0 NULL SET NEW.a = 10 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
+def a@b tr2 INSERT def a@b t1 0 NULL SET NEW.a = 100 * NEW.a ROW BEFORE NULL NULL OLD NEW NULL root@localhost utf8 utf8_general_ci latin1_swedish_ci
INSERT INTO `c@d` VALUES (2), (1);
SELECT * FROM `c@d`;
a
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 8162e1aca05..13d36fab2f1 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -40,7 +40,7 @@ CREATE TABLE `t1` (
`a` decimal(64,20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000');
+INSERT INTO `t1` VALUES (1234567890123456789012345678901234567890.00000000000000000000),(987654321098765432109876543210987654321.00000000000000000000);
DROP TABLE t1;
#
# Bug#2055 mysqldump should replace "-inf" numeric field values with "NULL"
@@ -77,7 +77,7 @@ CREATE TABLE `t1` (
`b` float DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t1` (
@@ -85,7 +85,7 @@ CREATE TABLE `t1` (
`b` float DEFAULT NULL
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -108,7 +108,7 @@ CREATE TABLE `t1` (
LOCK TABLES `t1` WRITE;
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
@@ -135,7 +135,7 @@ CREATE TABLE `t1` (
);
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456);
+INSERT INTO `t1` VALUES (1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456),(1.23450,2.3456);
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
@@ -2391,7 +2391,7 @@ trg3 UPDATE t1 begin
if new.a = -1 then
set @fired:= "Yes";
end if;
-end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end AFTER 0000-00-00 00:00:00 STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
INSERT INTO t1 (a) VALUES (1),(2),(3),(22);
update t1 set a = 4 where a=3;
@@ -2468,7 +2468,7 @@ DELIMITER ;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
+/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg3 after update on t1 for each row
begin
@@ -2500,7 +2500,7 @@ UNLOCK TABLES;
/*!50003 SET character_set_results = latin1 */ ;
/*!50003 SET collation_connection = latin1_swedish_ci */ ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
-/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
+/*!50003 SET sql_mode = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger trg4 before insert on t2 for each row
begin
@@ -2594,12 +2594,12 @@ trg3 UPDATE t1 begin
if new.a = -1 then
set @fired:= "Yes";
end if;
-end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end AFTER # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg4 INSERT t2 begin
if new.a > 10 then
set @fired:= "No";
end if;
-end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+end BEFORE # STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1, t2;
#
# Bug#9136 my_print_defaults changed behaviour between 4.1.7 and 4.1.10a
@@ -3554,11 +3554,11 @@ use test;
create user mysqltest_1@localhost;
create table t1(a int, b varchar(34));
reset master;
-mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
-mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need the RELOAD privilege for this operation (1227)
+mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) for this operation (1227)
+mysqldump: Couldn't execute 'FLUSH /*!40101 LOCAL */ TABLES': Access denied; you need (at least one of) the RELOAD privilege(s) 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)
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation (1227)
+mysqldump: Couldn't execute 'SHOW MASTER STATUS': Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation (1227)
grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop user mysqltest_1@localhost;
@@ -3611,7 +3611,7 @@ DROP TABLE IF EXISTS `TABLES`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TEMPORARY TABLE `TABLES` (
- `TABLE_CATALOG` varchar(512) DEFAULT NULL,
+ `TABLE_CATALOG` varchar(512) NOT NULL DEFAULT '',
`TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
`TABLE_TYPE` varchar(64) NOT NULL DEFAULT '',
@@ -4223,7 +4223,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
first ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
show create event ee1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
+ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
drop database first;
create database second;
use second;
@@ -4232,7 +4232,7 @@ Db Name Definer Time zone Type Execute at Interval value Interval field Starts E
second ee1 root@localhost UTC ONE TIME 2035-12-31 20:01:23 NULL NULL NULL NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
show create event ee1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ee1 UTC CREATE EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
+ee1 UTC CREATE DEFINER=`root`@`localhost` EVENT `ee1` ON SCHEDULE AT '2035-12-31 20:01:23' ON COMPLETION NOT PRESERVE ENABLE DO set @a=5 latin1 latin1_swedish_ci latin1_swedish_ci
create event ee2 on schedule at '2018-12-31 21:01:23' do set @a=5;
create event ee3 on schedule at '2030-12-31 22:01:23' do set @a=5;
show events;
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
index e5f5a53c1f3..84ef17857f4 100644
--- a/mysql-test/r/outfile.result
+++ b/mysql-test/r/outfile.result
Binary files differ
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 7e14a0ea7c8..625dbf0790f 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -433,14 +433,12 @@ create table t1 (a bigint)
partition by range (a)
(partition p0 values less than (0xFFFFFFFFFFFFFFFF),
partition p1 values less than (10));
-ERROR 42000: VALUES value must be of same type as partition function near '),
-partition p1 values less than (10))' at line 3
+ERROR HY000: VALUES value must be of same type as partition function
create table t1 (a bigint)
partition by list (a)
(partition p0 values in (0xFFFFFFFFFFFFFFFF),
partition p1 values in (10));
-ERROR 42000: VALUES value must be of same type as partition function near '),
-partition p1 values in (10))' at line 3
+ERROR HY000: VALUES value must be of same type as partition function
create table t1 (a bigint unsigned)
partition by range (a)
(partition p0 values less than (100),
@@ -1254,7 +1252,6 @@ COMMIT;
END|
CALL test.p1(12);
Warnings:
-Note 1051 Unknown table 't1'
Warning 1196 Some non-transactional changed tables couldn't be rolled back
CALL test.p1(13);
Warnings:
@@ -1435,7 +1432,7 @@ DROP TABLE t1;
CREATE TABLE t1 (a int)
PARTITION BY RANGE(a)
(PARTITION p0 VALUES LESS THAN (NULL));
-ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '))' at line 3
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
create table t1 (s1 int auto_increment primary key)
partition by list (s1)
(partition p1 values in (1),
diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result
new file mode 100644
index 00000000000..784df3045f0
--- /dev/null
+++ b/mysql-test/r/partition_column.result
@@ -0,0 +1,578 @@
+drop table if exists t1;
+create table t1 (a int, b int)
+partition by range columns (a,b)
+( partition p0 values less than (maxvalue, 10),
+partition p1 values less than (maxvalue, maxvalue));
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
+create table t1 (a int, b int, c int)
+partition by range columns (a,b,c)
+( partition p0 values less than (1, maxvalue, 10),
+partition p1 values less than (1, maxvalue, maxvalue));
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
+create table t1 (a varchar(1) character set latin1 collate latin1_general_ci)
+partition by range columns(a)
+( partition p0 values less than ('a'),
+partition p1 values less than ('b'),
+partition p2 values less than ('c'),
+partition p3 values less than ('d'));
+insert into t1 values ('A'),('a'),('B'),('b'),('C'),('c');
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+alter table t1 remove partitioning;
+select * from t1 where a > 'B' collate latin1_bin;
+a
+a
+b
+C
+c
+select * from t1 where a <> 'B' collate latin1_bin;
+a
+A
+a
+b
+C
+c
+drop table t1;
+create table t1 (a varchar(2) character set latin1,
+b varchar(2) character set latin1)
+partition by list columns(a,b)
+(partition p0 values in (('a','a')));
+insert into t1 values ('A','A');
+select * from t1 where b <> 'a' collate latin1_bin AND
+a = 'A' collate latin1_bin;
+a b
+A A
+alter table t1 remove partitioning;
+select * from t1 where b <> 'a' collate latin1_bin AND
+a = 'A' collate latin1_bin;
+a b
+A A
+drop table t1;
+create table t1 (a varchar(5))
+partition by list columns(a)
+( partition p0 values in ('\''),
+ partition p1 values in ('\\'),
+ partition p2 values in ('\0'));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(5) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN ('''') ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ('\\') ENGINE = MyISAM,
+ PARTITION p2 VALUES IN ('\0') ENGINE = MyISAM) */
+drop table t1;
+set @@sql_mode=allow_invalid_dates;
+create table t1 (a char, b char, c date)
+partition by range columns (a,b,c)
+( partition p0 values less than (0,0,to_days('3000-11-31')));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (a char, b char, c date)
+partition by range columns (a,b,c)
+( partition p0 values less than (0,0,'3000-11-31'));
+ERROR HY000: Partition column values of incorrect type
+set @@sql_mode='';
+create table t1 (a int, b char(10), c varchar(25), d datetime)
+partition by range columns(a,b,c,d)
+subpartition by hash (to_seconds(d))
+subpartitions 4
+( partition p0 values less than (1, 0, MAXVALUE, '1900-01-01'),
+partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
+partition p2 values less than (1, 'a', MAXVALUE, MAXVALUE),
+partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (a int, b char(10), c varchar(25), d datetime)
+partition by range columns(a,b,c,d)
+subpartition by hash (to_seconds(d))
+subpartitions 4
+( partition p0 values less than (1, '0', MAXVALUE, '1900-01-01'),
+partition p1 values less than (1, 'a', MAXVALUE, '1999-01-01'),
+partition p2 values less than (1, 'b', MAXVALUE, MAXVALUE),
+partition p3 values less than (1, MAXVALUE, MAXVALUE, MAXVALUE));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'0',MAXVALUE,'1900-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'a',MAXVALUE,'1999-01-01'
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,'b',MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+RANGE COLUMNS a,b,c,d 1,MAXVALUE,MAXVALUE,MAXVALUE
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(10) DEFAULT NULL,
+ `c` varchar(25) DEFAULT NULL,
+ `d` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE COLUMNS(a,b,c,d)
+SUBPARTITION BY HASH (to_seconds(d))
+SUBPARTITIONS 4
+(PARTITION p0 VALUES LESS THAN (1,'0',MAXVALUE,'1900-01-01') ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1,'a',MAXVALUE,'1999-01-01') ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (1,'b',MAXVALUE,MAXVALUE) ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (1,MAXVALUE,MAXVALUE,MAXVALUE) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a int, b int)
+partition by range columns (a,b)
+(partition p0 values less than (NULL, maxvalue));
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
+create table t1 (a int, b int)
+partition by list columns(a,b)
+( partition p0 values in ((maxvalue, 0)));
+Got one of the listed errors
+create table t1 (a int, b int)
+partition by list columns (a,b)
+( partition p0 values in ((0,0)));
+alter table t1 add partition
+(partition p1 values in (maxvalue, maxvalue));
+Got one of the listed errors
+drop table t1;
+create table t1 (a int, b int)
+partition by key (a,a);
+ERROR HY000: Duplicate partition field name 'a'
+create table t1 (a int, b int)
+partition by list columns(a,a)
+( partition p values in ((1,1)));
+ERROR HY000: Duplicate partition field name 'a'
+create table t1 (a int signed)
+partition by list (a)
+( partition p0 values in (1, 3, 5, 7, 9, NULL),
+partition p1 values in (2, 4, 6, 8, 0));
+insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
+select * from t1 where NULL <= a;
+a
+select * from t1 where a is null;
+a
+NULL
+explain partitions select * from t1 where a is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= 1;
+a
+1
+0
+drop table t1;
+create table t1 (a int signed)
+partition by list columns(a)
+( partition p0 values in (1, 3, 5, 7, 9, NULL),
+partition p1 values in (2, 4, 6, 8, 0));
+insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
+select * from t1 where a <= NULL;
+a
+select * from t1 where a is null;
+a
+NULL
+explain partitions select * from t1 where a is null;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= 1;
+a
+1
+0
+drop table t1;
+create table t1 (a int, b int)
+partition by list columns(a,b)
+( partition p0 values in ((1, NULL), (2, NULL), (NULL, NULL)),
+partition p1 values in ((1,1), (2,2)),
+partition p2 values in ((3, NULL), (NULL, 1)));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST COLUMNS a,b (1,NULL),(2,NULL),(NULL,NULL)
+LIST COLUMNS a,b (1,1),(2,2)
+LIST COLUMNS a,b (3,NULL),(NULL,1)
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a,b)
+(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
+insert into t1 values (3, NULL);
+insert into t1 values (NULL, 1);
+insert into t1 values (NULL, NULL);
+insert into t1 values (1, NULL);
+insert into t1 values (2, NULL);
+insert into t1 values (1,1);
+insert into t1 values (2,2);
+select * from t1 where a = 1;
+a b
+1 NULL
+1 1
+select * from t1 where a = 2;
+a b
+2 NULL
+2 2
+select * from t1 where a > 8;
+a b
+select * from t1 where a not between 8 and 8;
+a b
+2 NULL
+2 2
+3 NULL
+1 NULL
+1 1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a,b)
+(PARTITION p0 VALUES IN ((1,NULL),(2,NULL),(NULL,NULL)) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ((1,1),(2,2)) ENGINE = MyISAM,
+ PARTITION p2 VALUES IN ((3,NULL),(NULL,1)) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a int)
+partition by list (a)
+( partition p0 values in (1),
+partition p1 values in (1));
+ERROR HY000: Multiple definition of same constant in list partitioning
+create table t1 (a int)
+partition by list (a)
+( partition p0 values in (2, 1),
+partition p1 values in (4, NULL, 3));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST a 2,1
+LIST a NULL,4,3
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (a)
+(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (NULL,4,3) ENGINE = MyISAM) */
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+insert into t1 values (4);
+insert into t1 values (NULL);
+insert into t1 values (5);
+ERROR HY000: Table has no partition for value 5
+drop table t1;
+create table t1 (a int)
+partition by list columns(a)
+( partition p0 values in (2, 1),
+partition p1 values in ((4), (NULL), (3)));
+ERROR 42000: Row expressions in VALUES IN only allowed for multi-field column partitioning near '))' at line 4
+create table t1 (a int)
+partition by list columns(a)
+( partition p0 values in (2, 1),
+partition p1 values in (4, NULL, 3));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST COLUMNS a 2,1
+LIST COLUMNS a 4,NULL,3
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
+insert into t1 values (1);
+insert into t1 values (2);
+insert into t1 values (3);
+insert into t1 values (4);
+insert into t1 values (NULL);
+insert into t1 values (5);
+ERROR HY000: Table has no partition for value from column_list
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN (2,1) ENGINE = MyISAM,
+ PARTITION p1 VALUES IN (4,NULL,3) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a int, b char(10), c varchar(5), d int)
+partition by range columns(a,b,c)
+subpartition by key (c,d)
+subpartitions 3
+( partition p0 values less than (1,'abc','abc'),
+partition p1 values less than (2,'abc','abc'),
+partition p2 values less than (3,'abc','abc'),
+partition p3 values less than (4,'abc','abc'));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE COLUMNS a,b,c 1,'abc','abc'
+RANGE COLUMNS a,b,c 1,'abc','abc'
+RANGE COLUMNS a,b,c 1,'abc','abc'
+RANGE COLUMNS a,b,c 2,'abc','abc'
+RANGE COLUMNS a,b,c 2,'abc','abc'
+RANGE COLUMNS a,b,c 2,'abc','abc'
+RANGE COLUMNS a,b,c 3,'abc','abc'
+RANGE COLUMNS a,b,c 3,'abc','abc'
+RANGE COLUMNS a,b,c 3,'abc','abc'
+RANGE COLUMNS a,b,c 4,'abc','abc'
+RANGE COLUMNS a,b,c 4,'abc','abc'
+RANGE COLUMNS a,b,c 4,'abc','abc'
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` char(10) DEFAULT NULL,
+ `c` varchar(5) DEFAULT NULL,
+ `d` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
+SUBPARTITION BY KEY (c,d)
+SUBPARTITIONS 3
+(PARTITION p0 VALUES LESS THAN (1,'abc','abc') ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (2,'abc','abc') ENGINE = MyISAM,
+ PARTITION p2 VALUES LESS THAN (3,'abc','abc') ENGINE = MyISAM,
+ PARTITION p3 VALUES LESS THAN (4,'abc','abc') ENGINE = MyISAM) */
+insert into t1 values (1,'a','b',1),(2,'a','b',2),(3,'a','b',3);
+insert into t1 values (1,'b','c',1),(2,'b','c',2),(3,'b','c',3);
+insert into t1 values (1,'c','d',1),(2,'c','d',2),(3,'c','d',3);
+insert into t1 values (1,'d','e',1),(2,'d','e',2),(3,'d','e',3);
+select * from t1 where (a = 1 AND b < 'd' AND (c = 'b' OR (c = 'c' AND d = 1)) OR
+(a = 1 AND b >= 'a' AND (c = 'c' OR (c = 'd' AND d = 2))));
+a b c d
+1 a b 1
+1 b c 1
+drop table t1;
+create table t1 (a int, b varchar(2), c int)
+partition by range columns (a, b, c)
+(partition p0 values less than (1, 'A', 1),
+partition p1 values less than (1, 'B', 1));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE COLUMNS a,b,c 1,'A',1
+RANGE COLUMNS a,b,c 1,'B',1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL,
+ `b` varchar(2) DEFAULT NULL,
+ `c` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY RANGE COLUMNS(a,b,c)
+(PARTITION p0 VALUES LESS THAN (1,'A',1) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (1,'B',1) ENGINE = MyISAM) */
+insert into t1 values (1, 'A', 1);
+explain partitions select * from t1 where a = 1 AND b <= 'A' and c = 1;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 system NULL NULL NULL NULL 1
+select * from t1 where a = 1 AND b <= 'A' and c = 1;
+a b c
+1 A 1
+drop table t1;
+create table t1 (a char, b char, c char)
+partition by list columns(a)
+( partition p0 values in ('a'));
+insert into t1 (a) values ('a');
+select * from t1 where a = 'a';
+a b c
+a NULL NULL
+drop table t1;
+create table t1 (d time)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('2040-01-01'));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (d timestamp)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('2040-01-01'));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
+create table t1 (d bit(1))
+partition by range columns(d)
+( partition p0 values less than (0),
+partition p1 values less than (1));
+ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (maxvalue, 10));
+drop table t1;
+create table t1 (d date)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('2009-01-01'));
+drop table t1;
+create table t1 (d date)
+partition by range columns(d)
+( partition p0 values less than ('1999-01-01'),
+partition p1 values less than ('2000-01-01'));
+drop table t1;
+create table t1 (d date)
+partition by range columns(d)
+( partition p0 values less than ('2000-01-01'),
+partition p1 values less than ('3000-01-01'));
+drop table t1;
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p2 values less than (99,99),
+partition p1 values less than (99,999));
+insert into t1 values (99,998);
+select * from t1 where b = 998;
+a b
+99 998
+drop table t1;
+create table t1 as select to_seconds(null) as to_seconds;
+select data_type from information_schema.columns
+where column_name='to_seconds';
+data_type
+int
+drop table t1;
+create table t1 (a int, b int)
+partition by list columns(a,b)
+(partition p0 values in ((maxvalue,maxvalue)));
+ERROR 42000: Cannot use MAXVALUE as value in VALUES IN near 'maxvalue,maxvalue)))' at line 3
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (maxvalue,maxvalue));
+drop table t1;
+create table t1 (a int)
+partition by list columns(a)
+(partition p0 values in (0));
+select partition_method from information_schema.partitions where table_name='t1';
+partition_method
+LIST COLUMNS
+drop table t1;
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than ('H23456'),
+partition p1 values less than ('M23456'));
+insert into t1 values ('F23456');
+select * from t1;
+a
+F23456
+drop table t1;
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than (H23456),
+partition p1 values less than (M23456));
+ERROR 42S22: Unknown column 'H23456' in 'field list'
+create table t1 (a char(6))
+partition by range columns(a)
+(partition p0 values less than (23456),
+partition p1 values less than (23456));
+ERROR HY000: Partition column values of incorrect type
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (10));
+ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (1,1,1);
+ERROR HY000: Inconsistency in usage of column lists for partitioning
+create table t1 (a int, b int)
+partition by range columns(a,b)
+(partition p0 values less than (1, 0),
+partition p1 values less than (2, maxvalue),
+partition p2 values less than (3, 3),
+partition p3 values less than (10, maxvalue));
+insert into t1 values (11,0);
+ERROR HY000: Table has no partition for value from column_list
+insert into t1 values (0,1),(1,1),(2,1),(3,1),(3,4),(4,9),(9,1);
+select * from t1;
+a b
+0 1
+1 1
+2 1
+3 1
+3 4
+4 9
+9 1
+alter table t1
+partition by range columns(b,a)
+(partition p0 values less than (1,2),
+partition p1 values less than (3,3),
+partition p2 values less than (9,5));
+explain partitions select * from t1 where b < 2;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 7 Using where
+select * from t1 where b < 2;
+a b
+0 1
+1 1
+2 1
+3 1
+9 1
+explain partitions select * from t1 where b < 4;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 7 Using where
+select * from t1 where b < 4;
+a b
+0 1
+1 1
+2 1
+3 1
+9 1
+alter table t1 reorganize partition p1 into
+(partition p11 values less than (2,2),
+partition p12 values less than (3,3));
+alter table t1 reorganize partition p0 into
+(partition p01 values less than (0,3),
+partition p02 values less than (1,1));
+ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
+alter table t1 reorganize partition p2 into
+(partition p2 values less than(9,6,1));
+ERROR HY000: Inconsistency in usage of column lists for partitioning
+alter table t1 reorganize partition p2 into
+(partition p2 values less than (10));
+ERROR HY000: Inconsistency in usage of column lists for partitioning
+alter table t1 reorganize partition p2 into
+(partition p21 values less than (4,7),
+partition p22 values less than (9,5));
+explain partitions select * from t1 where b < 4;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p11,p12,p21 ALL NULL NULL NULL NULL 7 Using where
+select * from t1 where b < 4;
+a b
+0 1
+1 1
+2 1
+3 1
+9 1
+drop table t1;
+create table t1 (a int, b int)
+partition by list columns(a,b)
+subpartition by hash (b)
+subpartitions 2
+(partition p0 values in ((0,0), (1,1)),
+partition p1 values in ((1000,1000)));
+insert into t1 values (1000,1000);
+drop table t1;
+create table t1 (a char, b char, c char)
+partition by range columns(a,b,c)
+( partition p0 values less than ('a','b','c'));
+alter table t1 add partition
+(partition p1 values less than ('b','c','d'));
+drop table t1;
diff --git a/mysql-test/r/partition_column_prune.result b/mysql-test/r/partition_column_prune.result
new file mode 100644
index 00000000000..82c49453d43
--- /dev/null
+++ b/mysql-test/r/partition_column_prune.result
@@ -0,0 +1,66 @@
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+create table t1 (a char, b char, c char)
+partition by range columns(a,b,c)
+( partition p0 values less than ('a','b','c'));
+insert into t1 values ('a', NULL, 'd');
+explain partitions select * from t1 where a = 'a' AND c = 'd';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+select * from t1 where a = 'a' AND c = 'd';
+a b c
+a NULL d
+drop table t1;
+create table t1 (a int not null) partition by range columns(a) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition p2 values less than (30),
+partition p3 values less than (40),
+partition p4 values less than (50),
+partition p5 values less than (60),
+partition p6 values less than (70)
+);
+insert into t1 values (5),(15),(25),(35),(45),(55),(65);
+insert into t1 values (5),(15),(25),(35),(45),(55),(65);
+create table t2 (a int not null) partition by range(a) (
+partition p0 values less than (10),
+partition p1 values less than (20),
+partition p2 values less than (30),
+partition p3 values less than (40),
+partition p4 values less than (50),
+partition p5 values less than (60),
+partition p6 values less than (70)
+);
+insert into t2 values (5),(15),(25),(35),(45),(55),(65);
+insert into t2 values (5),(15),(25),(35),(45),(55),(65);
+explain partitions select * from t1 where a > 35 and a < 45;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p3,p4 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t2 where a > 35 and a < 45;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t2 p3,p4 ALL NULL NULL NULL NULL 4 Using where
+drop table t1, t2;
+create table t1 (a int not null, b int not null )
+partition by range columns(a,b) (
+partition p01 values less than (2,10),
+partition p02 values less than (2,20),
+partition p03 values less than (2,30),
+partition p11 values less than (4,10),
+partition p12 values less than (4,20),
+partition p13 values less than (4,30),
+partition p21 values less than (6,10),
+partition p22 values less than (6,20),
+partition p23 values less than (6,30)
+);
+insert into t1 values (2,5), (2,15), (2,25),
+(4,5), (4,15), (4,25), (6,5), (6,15), (6,25);
+insert into t1 select * from t1;
+explain partitions select * from t1 where a=2;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p01,p02,p03,p11 ALL NULL NULL NULL NULL 13 Using where
+explain partitions select * from t1 where a=4;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p11,p12,p13,p21 ALL NULL NULL NULL NULL 16 Using where
+explain partitions select * from t1 where a=2 and b < 22;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p01,p02,p03 ALL NULL NULL NULL NULL 16 Using where
+drop table t1;
diff --git a/mysql-test/r/partition_datatype.result b/mysql-test/r/partition_datatype.result
index 607afb71da5..47ea799f497 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -273,7 +273,7 @@ select * from t1 where a = 'y';
a
y
drop table t1;
-create table t1 (a varchar(65531)) partition by key (a);
+create table t1 (a varchar(3068)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
@@ -286,7 +286,7 @@ select * from t1 where a = 'bbbb';
a
bbbb
drop table t1;
-create table t1 (a varchar(65532)) partition by key (a);
+create table t1 (a varchar(3069)) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
@@ -299,7 +299,7 @@ select * from t1 where a = 'bbbb';
a
bbbb
drop table t1;
-create table t1 (a varchar(65533) not null) partition by key (a);
+create table t1 (a varchar(3070) not null) partition by key (a);
insert into t1 values ('bbbb');
insert into t1 values ('aaaa');
select * from t1 where a = 'aaaa';
@@ -312,6 +312,8 @@ select * from t1 where a = 'bbbb';
a
bbbb
drop table t1;
+create table t1 (a varchar(3070)) partition by key (a);
+ERROR HY000: The total length of the partitioning fields is too large
create table t1 (a varchar(65533)) partition by key (a);
ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
create table t1 (a varchar(65534) not null) partition by key (a);
diff --git a/mysql-test/r/partition_error.result b/mysql-test/r/partition_error.result
index 511806d64bd..d24c3de3cc0 100644
--- a/mysql-test/r/partition_error.result
+++ b/mysql-test/r/partition_error.result
@@ -361,8 +361,7 @@ partition by range (a)
partitions 2
(partition x1 values less than (4.0) tablespace ts1,
partition x2 values less than (8) tablespace ts2);
-ERROR 42000: VALUES value must be of same type as partition function near ') tablespace ts1,
-partition x2 values less than (8) tablespace ts2)' at line 8
+ERROR HY000: VALUES value must be of same type as partition function
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -412,8 +411,7 @@ partition by list (a)
partitions 2
(partition x1 values less than 4,
partition x2 values less than (5));
-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 '4,
-partition x2 values less than (5))' at line 8
+ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -423,7 +421,7 @@ partition by range (a)
partitions 2
(partition x1 values less than maxvalue,
partition x2 values less than (5));
-ERROR 42000: MAXVALUE can only be used in last partition definition near '))' at line 9
+ERROR HY000: MAXVALUE can only be used in last partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -433,7 +431,7 @@ partition by range (a)
partitions 2
(partition x1 values less than maxvalue,
partition x2 values less than maxvalue);
-ERROR 42000: MAXVALUE can only be used in last partition definition near 'maxvalue)' at line 9
+ERROR HY000: MAXVALUE can only be used in last partition definition
CREATE TABLE t1 (
a int not null,
b int not null,
@@ -602,8 +600,7 @@ partition by list (a)
partitions 2
(partition x1 values in (4.0, 12+8),
partition x2 values in (3, 21));
-ERROR 42000: VALUES value must be of same type as partition function near ' 12+8),
-partition x2 values in (3, 21))' at line 8
+ERROR HY000: VALUES value must be of same type as partition function
CREATE TABLE t1 (
a int not null,
b int not null,
diff --git a/mysql-test/r/partition_hash.result b/mysql-test/r/partition_hash.result
index 19da70db5a0..dcefd70ff43 100644
--- a/mysql-test/r/partition_hash.result
+++ b/mysql-test/r/partition_hash.result
@@ -93,7 +93,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
explain partitions select * from t1 where a >= 1 and a <= 5;
id select_type table partitions type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 p0,p1,p2,p3 ALL NULL NULL NULL NULL 9 Using where
+1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 9 Using where
drop table t1;
CREATE TABLE t1 (
a int not null,
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index 4323d167b10..d95e7dc43fd 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -1,4 +1,39 @@
drop table if exists t1;
+create table t1 (a varchar(5), b int signed, c varchar(10), d datetime)
+partition by range columns(b,c)
+subpartition by hash(to_seconds(d))
+( partition p0 values less than (2, 'b'),
+partition p1 values less than (4, 'd'),
+partition p2 values less than (10, 'za'));
+insert into t1 values ('a', 3, 'w', '2001-10-27 04:34:00');
+insert into t1 values ('r', 7, 'w', '2001-10-27 05:34:00');
+insert into t1 values ('g', 10, 'w', '2001-10-27 06:34:00');
+update t1 set a = 'c' where a > 'f';
+drop table t1;
+create table t1 (a varchar(5))
+engine=memory
+partition by range columns(a)
+( partition p0 values less than ('m'),
+partition p1 values less than ('za'));
+insert into t1 values ('j');
+update t1 set a = 'z' where (a >= 'j');
+drop table t1;
+create table t1 (a varchar(5))
+engine=myisam
+partition by range columns(a)
+( partition p0 values less than ('m'),
+partition p1 values less than ('za'));
+insert into t1 values ('j');
+update t1 set a = 'z' where (a >= 'j');
+drop table t1;
+create table t1 (a varchar(5))
+engine=innodb
+partition by range columns(a)
+( partition p0 values less than ('m'),
+partition p1 values less than ('za'));
+insert into t1 values ('j');
+update t1 set a = 'z' where (a >= 'j');
+drop table t1;
create table t1 (a int not null,
b datetime not null,
primary key (a,b))
diff --git a/mysql-test/r/partition_list.result b/mysql-test/r/partition_list.result
index a68a67c6386..e22fc11e5bb 100644
--- a/mysql-test/r/partition_list.result
+++ b/mysql-test/r/partition_list.result
@@ -54,6 +54,17 @@ subpartitions 2
partition p1 values in (1),
partition pnull values in (null, 2),
partition p3 values in (3));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+LIST a 0
+LIST a 0
+LIST a 1
+LIST a 1
+LIST a NULL,2
+LIST a NULL,2
+LIST a 3
+LIST a 3
insert into t1 values (0,0),(0,1),(1,0),(1,1),(null,0),(null,1);
insert into t1 values (2,0),(2,1),(3,0),(3,1);
explain partitions select * from t1 where a is null;
diff --git a/mysql-test/r/partition_mgm_err.result b/mysql-test/r/partition_mgm_err.result
index f8403988f47..a13278d724e 100644
--- a/mysql-test/r/partition_mgm_err.result
+++ b/mysql-test/r/partition_mgm_err.result
@@ -41,7 +41,7 @@ ERROR HY000: Reorganize of range partitions cannot change total ranges except fo
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (4),
PARTITION x11 VALUES LESS THAN (2));
-ERROR HY000: Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range
+ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
ALTER TABLE t1 REORGANIZE PARTITION x0,x1 INTO
(PARTITION x01 VALUES LESS THAN (6),
PARTITION x11 VALUES LESS THAN (4));
diff --git a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result
index 3128c57b2cf..d7790cd8075 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -656,6 +656,335 @@ EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
DROP TABLE t1;
+# TO_SECONDS, test of LIST and index
+CREATE TABLE t1 (a DATE, KEY(a))
+PARTITION BY LIST (TO_SECONDS(a))
+(PARTITION `p0001-01-01` VALUES IN (TO_SECONDS('0001-01-01')),
+PARTITION `p2001-01-01` VALUES IN (TO_SECONDS('2001-01-01')),
+PARTITION `pNULL` VALUES IN (NULL),
+PARTITION `p0000-01-02` VALUES IN (TO_SECONDS('0000-01-02')),
+PARTITION `p1001-01-01` VALUES IN (TO_SECONDS('1001-01-01')));
+INSERT INTO t1 VALUES ('0000-00-00'), ('0000-01-02'), ('0001-01-01'),
+('1001-00-00'), ('1001-01-01'), ('1002-00-00'), ('2001-01-01');
+SELECT * FROM t1 WHERE a < '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a <= '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a >= '1001-01-01';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-01-01';
+a
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-01-01';
+a
+1001-01-01
+SELECT * FROM t1 WHERE a < '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+SELECT * FROM t1 WHERE a <= '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a >= '1001-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-00-00';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-00-00';
+a
+1001-00-00
+# Disabling warnings for the invalid date
+SELECT * FROM t1 WHERE a < '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a <= '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a >= '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a > '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a = '1999-02-31';
+a
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+a
+0001-01-01
+1001-00-00
+1001-01-01
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1001-01-01 system a NULL NULL NULL 1
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 range a a 4 NULL 3 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
+# Disabling warnings for the invalid date
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL range a a 4 NULL 2 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ref a a 4 const 1 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 5 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 range a a 4 NULL 4 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL,p1001-01-01 range a a 4 NULL 2 Using where; Using index
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 range a a 4 NULL 3 Using where; Using index
+# test without index
+ALTER TABLE t1 DROP KEY a;
+SELECT * FROM t1 WHERE a < '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a <= '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a >= '1001-01-01';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-01-01';
+a
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-01-01';
+a
+1001-01-01
+SELECT * FROM t1 WHERE a < '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+SELECT * FROM t1 WHERE a <= '1001-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+SELECT * FROM t1 WHERE a >= '1001-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a > '1001-00-00';
+a
+1001-01-01
+1002-00-00
+2001-01-01
+SELECT * FROM t1 WHERE a = '1001-00-00';
+a
+1001-00-00
+# Disabling warnings for the invalid date
+SELECT * FROM t1 WHERE a < '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a <= '1999-02-31';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a >= '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a > '1999-02-31';
+a
+2001-01-01
+SELECT * FROM t1 WHERE a = '1999-02-31';
+a
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+a
+0000-00-00
+0000-01-02
+0001-01-01
+1001-00-00
+1001-01-01
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+a
+1001-00-00
+1001-01-01
+1002-00-00
+SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+a
+0001-01-01
+1001-00-00
+1001-01-01
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p1001-01-01 system NULL NULL NULL NULL 1
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1001-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+# Disabling warnings for the invalid date
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a >= '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a > '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p2001-01-01,pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a = '1999-02-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0000-00-00' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p0000-01-02,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-02' AND '1002-00-00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a BETWEEN '0001-01-01' AND '1001-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0001-01-01,pNULL,p1001-01-01 ALL NULL NULL NULL NULL 7 Using where
+DROP TABLE t1;
# Test with DATETIME column NOT NULL
CREATE TABLE t1 (
a int(10) unsigned NOT NULL,
@@ -2228,3 +2557,22 @@ explain partitions select * from t1 where recdate < '2006-01-01 00:00:00';
id select_type table partitions type possible_keys key key_len ref rows Extra
1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
drop table t1;
+#
+# BUG#33730 Full table scan instead selected partitions for query more than 10 partitions
+#
+create table t0 (a int);
+insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t1 (a int)
+partition by range(a+0) (
+partition p0 values less than (64),
+partition p1 values less than (128),
+partition p2 values less than (255)
+);
+insert into t1 select A.a + 10*B.a from t0 A, t0 B;
+explain partitions select * from t1 where a between 10 and 13;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 64 Using where
+explain partitions select * from t1 where a between 10 and 10+33;
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1,p2 ALL NULL NULL NULL NULL 100 Using where
+drop table t0, t1;
diff --git a/mysql-test/r/partition_range.result b/mysql-test/r/partition_range.result
index 02d2f6359c5..87cb4fba306 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -1,6 +1,99 @@
drop table if exists t1, t2;
create table t1 (a int)
partition by range (a)
+( partition p0 values less than (NULL),
+partition p1 values less than (MAXVALUE));
+ERROR HY000: Not allowed to use NULL value in VALUES LESS THAN
+create table t1 (a datetime not null)
+partition by range (TO_SECONDS(a))
+( partition p0 VALUES LESS THAN (TO_SECONDS('2007-03-08 00:00:00')),
+partition p1 VALUES LESS THAN (TO_SECONDS('2007-04-01 00:00:00')));
+select partition_method, partition_expression, partition_description
+from information_schema.partitions where table_name = "t1";
+partition_method partition_expression partition_description
+RANGE TO_SECONDS(a) 63340531200
+RANGE TO_SECONDS(a) 63342604800
+INSERT INTO t1 VALUES ('2007-03-01 12:00:00'), ('2007-03-07 12:00:00');
+INSERT INTO t1 VALUES ('2007-03-08 12:00:00'), ('2007-03-15 12:00:00');
+explain partitions select * from t1 where a < '2007-03-08 00:00:00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 2 Using where
+explain partitions select * from t1 where a < '2007-03-08 00:00:01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t1 where a <= '2007-03-08 00:00:00';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t1 where a <= '2007-03-07 23:59:59';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
+explain partitions select * from t1 where a < '2007-03-07 23:59:59';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 ALL NULL NULL NULL NULL 4 Using where
+drop table t1;
+create table t1 (a date)
+partition by range(to_seconds(a))
+(partition p0 values less than (to_seconds('2004-01-01')),
+partition p1 values less than (to_seconds('2005-01-01')));
+insert into t1 values ('2003-12-30'),('2004-12-31');
+select * from t1;
+a
+2003-12-30
+2004-12-31
+explain partitions select * from t1 where a <= '2003-12-31';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+select * from t1 where a <= '2003-12-31';
+a
+2003-12-30
+explain partitions select * from t1 where a <= '2005-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= '2005-01-01';
+a
+2003-12-30
+2004-12-31
+drop table t1;
+create table t1 (a datetime)
+partition by range(to_seconds(a))
+(partition p0 values less than (to_seconds('2004-01-01 12:00:00')),
+partition p1 values less than (to_seconds('2005-01-01 12:00:00')));
+insert into t1 values ('2004-01-01 11:59:29'),('2005-01-01 11:59:59');
+select * from t1;
+a
+2004-01-01 11:59:29
+2005-01-01 11:59:59
+explain partitions select * from t1 where a <= '2004-01-01 11:59.59';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+select * from t1 where a <= '2004-01-01 11:59:59';
+a
+2004-01-01 11:59:29
+explain partitions select * from t1 where a <= '2005-01-01';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0,p1 ALL NULL NULL NULL NULL 2 Using where
+select * from t1 where a <= '2005-01-01';
+a
+2004-01-01 11:59:29
+drop table t1;
+create table t1 (a int, b char(20))
+partition by range columns(a,b)
+(partition p0 values less than (1));
+ERROR 42000: Inconsistency in usage of column lists for partitioning near '))' at line 3
+create table t1 (a int, b char(20))
+partition by range(a)
+(partition p0 values less than (1,"b"));
+ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
+create table t1 (a int, b char(20))
+partition by range(a)
+(partition p0 values less than (1,"b"));
+ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
+create table t1 (a int, b char(20))
+partition by range columns(b)
+(partition p0 values less than ("b"));
+drop table t1;
+create table t1 (a int)
+partition by range (a)
( partition p0 values less than (maxvalue));
alter table t1 add partition (partition p1 values less than (100000));
ERROR HY000: MAXVALUE can only be used in last partition definition
diff --git a/mysql-test/r/partition_truncate.result b/mysql-test/r/partition_truncate.result
new file mode 100644
index 00000000000..8f594a319df
--- /dev/null
+++ b/mysql-test/r/partition_truncate.result
@@ -0,0 +1,18 @@
+drop table if exists t1, t2, t3, t4;
+create table t1 (a int)
+partition by list (a)
+(partition p1 values in (0));
+alter table t1 truncate partition p1,p1;
+ERROR HY000: Incorrect partition name
+alter table t1 truncate partition p0;
+ERROR HY000: Incorrect partition name
+drop table t1;
+create table t1 (a int)
+partition by list (a)
+subpartition by hash (a)
+subpartitions 1
+(partition p1 values in (1)
+(subpartition sp1));
+alter table t1 truncate partition sp1;
+ERROR HY000: Incorrect partition name
+drop table t1;
diff --git a/mysql-test/r/partition_utf8.result b/mysql-test/r/partition_utf8.result
new file mode 100644
index 00000000000..0fae7bb16b6
--- /dev/null
+++ b/mysql-test/r/partition_utf8.result
@@ -0,0 +1,53 @@
+set names utf8;
+create table t1 (a varchar(2) character set cp1250)
+partition by list columns (a)
+( partition p0 values in (0x81));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN (_cp1250 0x81) ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a varchar(2) character set cp1250)
+partition by list columns (a)
+( partition p0 values in (0x80));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET cp1250 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN ('€') ENGINE = MyISAM) */
+drop table t1;
+create table t1 (a varchar(1500), b varchar(1570))
+partition by list columns(a,b)
+( partition p0 values in (('a','b')));
+ERROR HY000: The total length of the partitioning fields is too large
+create table t1 (a varchar(1023) character set utf8 collate utf8_spanish2_ci)
+partition by range columns(a)
+( partition p0 values less than ('CZ'),
+partition p1 values less than ('CH'),
+partition p2 values less than ('D'));
+insert into t1 values ('czz'),('chi'),('ci'),('cg');
+select * from t1 where a between 'cg' AND 'ci';
+a
+ci
+cg
+drop table t1;
+create table t1 (a varchar(2) character set ucs2)
+partition by list columns (a)
+(partition p0 values in (0x2020),
+partition p1 values in (''));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(2) CHARACTER SET ucs2 DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST COLUMNS(a)
+(PARTITION p0 VALUES IN ('†') ENGINE = MyISAM,
+ PARTITION p1 VALUES IN ('') ENGINE = MyISAM) */
+insert into t1 values ('');
+insert into t1 values (_ucs2 0x2020);
+drop table t1;
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
index 782d2a5a9a4..85fbd1353cc 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -12,6 +12,15 @@ CREATE TABLE t1(a int) ENGINE=EXAMPLE;
SELECT * FROM t1;
a
DROP TABLE t1;
+set global example_ulong_var=500;
+set global example_enum_var= e1;
+show status like 'example%';
+Variable_name Value
+example_func_example enum_var is 0, ulong_var is 500, really
+show variables like 'example%';
+Variable_name Value
+example_enum_var e1
+example_ulong_var 500
UNINSTALL PLUGIN example;
UNINSTALL PLUGIN EXAMPLE;
ERROR 42000: PLUGIN EXAMPLE does not exist
diff --git a/mysql-test/r/profiling.result b/mysql-test/r/profiling.result
index c96074eb830..f20c459d7dc 100644
--- a/mysql-test/r/profiling.result
+++ b/mysql-test/r/profiling.result
@@ -298,6 +298,13 @@ id
1
2
3
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
+Warning 1292 Truncated incorrect DOUBLE value: 'hello'
select @@profiling;
@@profiling
1
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 1f8a077af40..6c7e83134d7 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -1194,13 +1194,13 @@ SET @aux= "SELECT COUNT(*)
prepare my_stmt from @aux;
execute my_stmt;
COUNT(*)
-39
+40
execute my_stmt;
COUNT(*)
-39
+40
execute my_stmt;
COUNT(*)
-39
+40
deallocate prepare my_stmt;
drop procedure if exists p1|
drop table if exists t1|
@@ -2748,17 +2748,21 @@ Warnings:
Note 1051 Unknown table 't1'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't1'
drop table if exists t2;
Warnings:
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't2'
drop table if exists t1, t2;
Warnings:
Note 1051 Unknown table 't1'
Note 1051 Unknown table 't2'
call proc_1();
Level Code Message
+Note 1051 Unknown table 't1'
+Note 1051 Unknown table 't2'
drop procedure proc_1;
create function func_1() returns int begin show warnings; return 1; end|
ERROR 0A000: Not allowed to return a result set from a function
@@ -2922,4 +2926,165 @@ execute stmt;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
drop table t1;
deallocate prepare stmt;
+
End of 5.1 tests.
+
+#
+# WL#4435: Support OUT-parameters in prepared statements.
+#
+
+DROP PROCEDURE IF EXISTS p_string;
+DROP PROCEDURE IF EXISTS p_double;
+DROP PROCEDURE IF EXISTS p_int;
+DROP PROCEDURE IF EXISTS p_decimal;
+
+CREATE PROCEDURE p_string(
+IN v0 INT,
+OUT v1 CHAR(32),
+IN v2 CHAR(32),
+INOUT v3 CHAR(32))
+BEGIN
+SET v0 = -1;
+SET v1 = 'test_v1';
+SET v2 = 'n/a';
+SET v3 = 'test_v3';
+END|
+
+CREATE PROCEDURE p_double(
+IN v0 INT,
+OUT v1 DOUBLE(4, 2),
+IN v2 DOUBLE(4, 2),
+INOUT v3 DOUBLE(4, 2))
+BEGIN
+SET v0 = -1;
+SET v1 = 12.34;
+SET v2 = 98.67;
+SET v3 = 56.78;
+END|
+
+CREATE PROCEDURE p_int(
+IN v0 CHAR(10),
+OUT v1 INT,
+IN v2 INT,
+INOUT v3 INT)
+BEGIN
+SET v0 = 'n/a';
+SET v1 = 1234;
+SET v2 = 9876;
+SET v3 = 5678;
+END|
+
+CREATE PROCEDURE p_decimal(
+IN v0 INT,
+OUT v1 DECIMAL(4, 2),
+IN v2 DECIMAL(4, 2),
+INOUT v3 DECIMAL(4, 2))
+BEGIN
+SET v0 = -1;
+SET v1 = 12.34;
+SET v2 = 98.67;
+SET v3 = 56.78;
+END|
+
+PREPARE stmt_str FROM 'CALL p_string(?, ?, ?, ?)';
+PREPARE stmt_dbl FROM 'CALL p_double(?, ?, ?, ?)';
+PREPARE stmt_int FROM 'CALL p_int(?, ?, ?, ?)';
+PREPARE stmt_dec FROM 'CALL p_decimal(?, ?, ?, ?)';
+
+SET @x_str_1 = NULL;
+SET @x_str_2 = NULL;
+SET @x_str_3 = NULL;
+SET @x_dbl_1 = NULL;
+SET @x_dbl_2 = NULL;
+SET @x_dbl_3 = NULL;
+SET @x_int_1 = NULL;
+SET @x_int_2 = NULL;
+SET @x_int_3 = NULL;
+SET @x_dec_1 = NULL;
+SET @x_dec_2 = NULL;
+SET @x_dec_3 = NULL;
+
+-- Testing strings...
+
+EXECUTE stmt_str USING @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+SELECT @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+@x_int_1 @x_str_1 @x_str_2 @x_str_3
+NULL test_v1 NULL test_v3
+
+EXECUTE stmt_str USING @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+SELECT @x_int_1, @x_str_1, @x_str_2, @x_str_3;
+@x_int_1 @x_str_1 @x_str_2 @x_str_3
+NULL test_v1 NULL test_v3
+
+-- Testing doubles...
+
+EXECUTE stmt_dbl USING @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+SELECT @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+@x_int_1 @x_dbl_1 @x_dbl_2 @x_dbl_3
+NULL 12.34 NULL 56.78
+
+EXECUTE stmt_dbl USING @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+SELECT @x_int_1, @x_dbl_1, @x_dbl_2, @x_dbl_3;
+@x_int_1 @x_dbl_1 @x_dbl_2 @x_dbl_3
+NULL 12.34 NULL 56.78
+
+-- Testing ints...
+
+EXECUTE stmt_int USING @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+SELECT @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+@x_str_1 @x_int_1 @x_int_2 @x_int_3
+test_v1 1234 NULL 5678
+
+EXECUTE stmt_int USING @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+SELECT @x_str_1, @x_int_1, @x_int_2, @x_int_3;
+@x_str_1 @x_int_1 @x_int_2 @x_int_3
+test_v1 1234 NULL 5678
+
+-- Testing decs...
+
+EXECUTE stmt_dec USING @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+SELECT @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+@x_int_1 @x_dec_1 @x_dec_2 @x_dec_3
+1234 12.34 NULL 56.78
+
+EXECUTE stmt_dec USING @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+SELECT @x_int_1, @x_dec_1, @x_dec_2, @x_dec_3;
+@x_int_1 @x_dec_1 @x_dec_2 @x_dec_3
+1234 12.34 NULL 56.78
+
+DEALLOCATE PREPARE stmt_str;
+DEALLOCATE PREPARE stmt_dbl;
+DEALLOCATE PREPARE stmt_int;
+DEALLOCATE PREPARE stmt_dec;
+
+DROP PROCEDURE p_string;
+DROP PROCEDURE p_double;
+DROP PROCEDURE p_int;
+DROP PROCEDURE p_decimal;
+
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+
+CREATE PROCEDURE p1(OUT v1 CHAR(10))
+SET v1 = 'test1';
+
+CREATE PROCEDURE p2(OUT v2 CHAR(10))
+BEGIN
+SET @query = 'CALL p1(?)';
+PREPARE stmt1 FROM @query;
+EXECUTE stmt1 USING @u1;
+DEALLOCATE PREPARE stmt1;
+SET v2 = @u1;
+END|
+
+CALL p2(@a);
+SELECT @a;
+@a
+test1
+
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+
+# End of WL#4435.
+
+End of 6.0 tests.
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index 1b2a0cc50b2..3ab65c24040 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -279,6 +279,9 @@ b char(10) YES NULL
SET @arg00=1;
execute stmt4 using @arg00;
Field Type Null Key Default Extra
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'a'
+Warning 1292 Truncated incorrect DOUBLE value: 'b'
prepare stmt4 from ' show columns from t2 from test like ''a%'' ';
execute stmt4;
Field Type Null Key Default Extra
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index a91d13d11a1..c51863b73f7 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1807,8 +1807,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1829,7 +1829,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1927,8 +1927,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1974,8 +1974,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2024,8 +2024,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2064,8 +2064,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2112,8 +2112,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2156,8 +2156,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2202,8 +2202,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2240,8 +2240,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 50c94d6cc4e..2670451f24e 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1790,8 +1790,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1812,7 +1812,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1910,8 +1910,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1957,8 +1957,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2007,8 +2007,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2047,8 +2047,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2095,8 +2095,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2139,8 +2139,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2185,8 +2185,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2223,8 +2223,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index a85809d3800..4372c470b2d 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -60,8 +60,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1791,8 +1791,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1813,7 +1813,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1911,8 +1911,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1958,8 +1958,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2008,8 +2008,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2048,8 +2048,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2096,8 +2096,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2140,8 +2140,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2186,8 +2186,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2224,8 +2224,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index fd1b69c0ffd..35a43f7c032 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -102,8 +102,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -1727,8 +1727,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -1749,7 +1749,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -1847,8 +1847,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1894,8 +1894,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1944,8 +1944,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -1984,8 +1984,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2032,8 +2032,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2076,8 +2076,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2122,8 +2122,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -2160,8 +2160,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -3124,8 +3124,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63
def test t9 t9 c8 c8 5 22 1 Y 32768 31 63
def test t9 t9 c9 c9 5 22 1 Y 32768 31 63
def test t9 t9 c10 c10 5 22 1 Y 32768 31 63
-def test t9 t9 c11 c11 246 9 6 Y 0 4 63
-def test t9 t9 c12 c12 246 10 6 Y 0 4 63
+def test t9 t9 c11 c11 246 9 6 Y 32768 4 63
+def test t9 t9 c12 c12 246 10 6 Y 32768 4 63
def test t9 t9 c13 c13 10 10 10 Y 128 0 63
def test t9 t9 c14 c14 12 19 19 Y 128 0 63
def test t9 t9 c15 c15 7 19 19 N 9441 0 63
@@ -4749,8 +4749,8 @@ select * from t5 ;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t5 t5 const01 const01 3 1 1 N 32769 0 63
def test t5 t5 param01 param01 8 20 1 Y 32768 0 63
-def test t5 t5 const02 const02 246 4 3 N 1 1 63
-def test t5 t5 param02 param02 246 67 32 Y 0 30 63
+def test t5 t5 const02 const02 246 4 3 N 32769 1 63
+def test t5 t5 param02 param02 246 67 32 Y 32768 30 63
def test t5 t5 const03 const03 5 17 1 N 32769 31 63
def test t5 t5 param03 param03 5 23 1 Y 32768 31 63
def test t5 t5 const04 const04 253 3 3 N 1 0 8
@@ -4771,7 +4771,7 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63
def test t5 t5 param11 param11 8 20 4 Y 32768 0 63
def test t5 t5 const12 const12 254 0 0 Y 128 0 63
def test t5 t5 param12 param12 8 20 0 Y 32768 0 63
-def test t5 t5 param13 param13 246 67 0 Y 0 30 63
+def test t5 t5 param13 param13 246 67 0 Y 32768 30 63
def test t5 t5 param14 param14 252 4294967295 0 Y 16 0 8
def test t5 t5 param15 param15 252 4294967295 0 Y 144 0 63
const01 8
@@ -4869,8 +4869,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -4916,8 +4916,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -4966,8 +4966,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5006,8 +5006,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5054,8 +5054,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5098,8 +5098,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5144,8 +5144,8 @@ def @arg07 5 23 1 Y 32896 31 63
def @arg08 5 23 1 Y 32896 31 63
def @arg09 5 23 1 Y 32896 31 63
def @arg10 5 23 1 Y 32896 31 63
-def @arg11 246 83 6 Y 128 30 63
-def @arg12 246 83 6 Y 128 30 63
+def @arg11 246 83 6 Y 32896 30 63
+def @arg12 246 83 6 Y 32896 30 63
def @arg13 251 16777216 10 Y 128 31 63
def @arg14 251 16777216 19 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
@@ -5182,8 +5182,8 @@ def @arg07 5 23 0 Y 32896 31 63
def @arg08 5 23 0 Y 32896 31 63
def @arg09 5 23 0 Y 32896 31 63
def @arg10 5 23 0 Y 32896 31 63
-def @arg11 246 83 0 Y 128 30 63
-def @arg12 246 83 0 Y 128 30 63
+def @arg11 246 83 0 Y 32896 30 63
+def @arg12 246 83 0 Y 32896 30 63
def @arg13 251 16777216 0 Y 128 31 63
def @arg14 251 16777216 0 Y 128 31 63
def @arg15 251 16777216 19 Y 128 31 63
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 2817bec2198..20e0fe2f1cc 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -889,7 +889,7 @@ select group_concat(a) FROM t1 group by b;
group_concat(a)
1234567890
Warnings:
-Warning 1260 1 line(s) were cut by GROUP_CONCAT()
+Warning 1260 Row 1 was cut by GROUP_CONCAT()
set group_concat_max_len=1024;
select group_concat(a) FROM t1 group by b;
group_concat(a)
@@ -992,19 +992,19 @@ COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050328 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 0
+Warning 1292 Incorrect datetime value: '20050328 invalid' for column 'date' at row 1
SELECT COUNT(*) FROM t1 WHERE date BETWEEN '20050326' AND '20050327 invalid';
COUNT(*)
0
Warnings:
Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
-Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 0
+Warning 1292 Incorrect datetime value: '20050327 invalid' for column 'date' at row 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
diff --git a/mysql-test/r/query_cache_disabled.result b/mysql-test/r/query_cache_disabled.result
new file mode 100644
index 00000000000..f2f58580ca2
--- /dev/null
+++ b/mysql-test/r/query_cache_disabled.result
@@ -0,0 +1,14 @@
+SHOW GLOBAL VARIABLES LIKE 'query_cache_type';
+Variable_name Value
+query_cache_type OFF
+SET GLOBAL query_cache_type=ON;
+ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
+SET GLOBAL query_cache_type=DEMAND;
+ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
+SET GLOBAL query_cache_type=OFF;
+ERROR HY000: Query cache is disabled; restart the server with query_cache_type=1 to enable it
+SET GLOBAL query_cache_size=1024*1024;
+SHOW GLOBAL VARIABLES LIKE 'query_cache_size';
+Variable_name Value
+query_cache_size 1048576
+SET GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result
index 0efb2540c64..f686e876a60 100644
--- a/mysql-test/r/query_cache_ps_no_prot.result
+++ b/mysql-test/r/query_cache_ps_no_prot.result
@@ -529,5 +529,46 @@ DROP DATABASE mysqltest1;
use test;
########################################################################
+#
+# Bug#27430 Crash in subquery code when in PS and table DDL changed
+# after PREPARE
+# Check the effect of automatic reprepare on query cache
+#
+########################################################################
+drop table if exists t1;
+create table t1 (a varchar(255));
+insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
+flush status;
+prepare stmt from "select a from t1";
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=0;
+alter table t1 add column b int;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=100000;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+#
+# Sic: ALTER TABLE caused an automatic reprepare
+# of the prepared statement. Since the query cache was disabled
+# at the time of reprepare, the new prepared statement doesn't
+# work with it.
+#
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+# Cleanup
+deallocate prepare stmt;
+drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status;
diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result
index dc0c4a0193a..e594161f2e9 100644
--- a/mysql-test/r/query_cache_ps_ps_prot.result
+++ b/mysql-test/r/query_cache_ps_ps_prot.result
@@ -529,5 +529,46 @@ DROP DATABASE mysqltest1;
use test;
########################################################################
+#
+# Bug#27430 Crash in subquery code when in PS and table DDL changed
+# after PREPARE
+# Check the effect of automatic reprepare on query cache
+#
+########################################################################
+drop table if exists t1;
+create table t1 (a varchar(255));
+insert into t1 (a) values ("Pack my box with five dozen liquor jugs.");
+flush status;
+prepare stmt from "select a from t1";
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=0;
+alter table t1 add column b int;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+set @@global.query_cache_size=100000;
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+execute stmt;
+a
+Pack my box with five dozen liquor jugs.
+#
+# Sic: ALTER TABLE caused an automatic reprepare
+# of the prepared statement. Since the query cache was disabled
+# at the time of reprepare, the new prepared statement doesn't
+# work with it.
+#
+show status like 'Qcache_hits';
+Variable_name Value
+Qcache_hits 0
+show status like 'Qcache_queries_in_cache';
+Variable_name Value
+Qcache_queries_in_cache 0
+# Cleanup
+deallocate prepare stmt;
+drop table t1;
set @@global.query_cache_size=@initial_query_cache_size;
flush status;
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 64e00521cd2..aa04bfc25ea 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -1587,8 +1587,8 @@ str_to_date('2007-20-00', '%Y-%m-%d') <= ''
NULL
Warnings:
Warning 1292 Truncated incorrect date value: ''
-Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
-Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
+Warning 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
+Warning 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
SELECT str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20';
str_to_date('2007-10-00', '%Y-%m-%d') BETWEEN '' AND '2007/10/20'
1
@@ -1598,7 +1598,7 @@ SELECT str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND '';
str_to_date('2007-20-00', '%Y-%m-%d') BETWEEN '2007/10/20' AND ''
NULL
Warnings:
-Error 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
+Warning 1411 Incorrect datetime value: '2007-20-00' for function str_to_date
SELECT str_to_date('', '%Y-%m-%d');
str_to_date('', '%Y-%m-%d')
0000-00-00
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index d0b2a575a32..75ce166cb24 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -4490,7 +4490,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '1' AS `a`,'1' AS `b` from `test`.`t1` where 1
+Note 1003 select '1' AS `a`,'1' AS `b` from dual where 1
SELECT * FROM t1 WHERE (a=a AND a=a) OR b > 2;
a b
1 1
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index e6550bee954..091d932a6fc 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -61,18 +61,18 @@ Table Op Msg_type Msg_text
test.t1 check status OK
show index from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
-def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
-def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
-def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
-def STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8
-def STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
-def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
-def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
-def STATISTICS PACKED Packed 253 10 0 Y 0 0 8
-def STATISTICS NULLABLE Null 253 3 0 N 1 0 8
-def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
-def STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
+def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 8
+def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 8
+def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 1 N 1 0 8
+def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 8
+def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
+def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
+def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 8
+def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 8
+def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 8
+def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 8
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 a A 5 NULL NULL BTREE
t1 1 b 1 b A 1 NULL NULL BTREE
@@ -99,45 +99,45 @@ drop table t1;
-- after Bug#29394 is implemented.
show variables like "wait_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "WAIT_timeout%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 12 N 1 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 5 Y 0 0 8
Variable_name Value
wait_timeout 28800
show variables like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
-def VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_NAME Variable_name 253 64 0 N 1 0 8
+def information_schema VARIABLES VARIABLES VARIABLE_VALUE Value 253 1024 0 Y 0 0 8
Variable_name Value
show table status from test like "this_doesn't_exists%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TABLES TABLE_NAME Name 253 64 0 N 1 0 8
-def TABLES ENGINE Engine 253 64 0 Y 0 0 8
-def TABLES VERSION Version 8 21 0 Y 32800 0 63
-def TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
-def TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
-def TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
-def TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
-def TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63
-def TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63
-def TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63
-def TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
-def TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
-def TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
-def TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
-def TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
-def TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
-def TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
-def TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
+def information_schema TABLES TABLES TABLE_NAME Name 253 64 0 N 1 0 8
+def information_schema TABLES TABLES ENGINE Engine 253 64 0 Y 0 0 8
+def information_schema TABLES TABLES VERSION Version 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES ROW_FORMAT Row_format 253 10 0 Y 0 0 8
+def information_schema TABLES TABLES TABLE_ROWS Rows 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES AVG_ROW_LENGTH Avg_row_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES DATA_LENGTH Data_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES MAX_DATA_LENGTH Max_data_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES INDEX_LENGTH Index_length 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES DATA_FREE Data_free 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES AUTO_INCREMENT Auto_increment 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES CREATE_TIME Create_time 12 19 0 Y 128 0 63
+def information_schema TABLES TABLES UPDATE_TIME Update_time 12 19 0 Y 128 0 63
+def information_schema TABLES TABLES CHECK_TIME Check_time 12 19 0 Y 128 0 63
+def information_schema TABLES TABLES TABLE_COLLATION Collation 253 32 0 Y 0 0 8
+def information_schema TABLES TABLES CHECKSUM Checksum 8 21 0 Y 32800 0 63
+def information_schema TABLES TABLES CREATE_OPTIONS Create_options 253 255 0 Y 0 0 8
+def information_schema TABLES TABLES TABLE_COMMENT Comment 253 80 0 N 1 0 8
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
show databases;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
+def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database 253 64 18 N 1 0 8
Database
information_schema
mtr
@@ -145,7 +145,7 @@ mysql
test
show databases like "test%";
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8
+def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (test%) 253 64 4 N 1 0 8
Database (test%)
test
create table t1 (f1 int not null, f2 int not null, f3 int not null, f4 int not null, primary key(f1,f2,f3,f4));
@@ -626,18 +626,18 @@ PRIMARY KEY(field1(1000))
);
show index from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63
-def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
-def STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63
-def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
-def STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63
-def STATISTICS COLLATION Collation 253 1 1 Y 0 0 63
-def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
-def STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63
-def STATISTICS PACKED Packed 253 10 0 Y 0 0 63
-def STATISTICS NULLABLE Null 253 3 0 N 1 0 63
-def STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63
-def STATISTICS COMMENT Comment 253 16 0 Y 0 0 63
+def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 64 2 N 1 0 63
+def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 64 7 N 1 0 63
+def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 64 6 N 1 0 63
+def information_schema STATISTICS STATISTICS COLLATION Collation 253 1 1 Y 0 0 63
+def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
+def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 4 Y 32768 0 63
+def information_schema STATISTICS STATISTICS PACKED Packed 253 10 0 Y 0 0 63
+def information_schema STATISTICS STATISTICS NULLABLE Null 253 3 0 N 1 0 63
+def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 16 5 N 1 0 63
+def information_schema STATISTICS STATISTICS COMMENT Comment 253 16 0 Y 0 0 63
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 field1 A 0 1000 NULL BTREE
drop table t1;
@@ -808,7 +808,6 @@ show plugins;
show columns in t1;
show slave hosts;
show keys in t1;
-show column types;
show table types;
show storage engines;
show authors;
@@ -859,21 +858,21 @@ set names utf8;
----------------------------------------------------------------
SHOW CHARACTER SET LIKE 'utf8';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
-def CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
-def CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
-def CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
+def information_schema CHARACTER_SETS CHARACTER_SETS CHARACTER_SET_NAME Charset 253 96 4 N 1 0 33
+def information_schema CHARACTER_SETS CHARACTER_SETS DESCRIPTION Description 253 180 13 N 1 0 33
+def information_schema CHARACTER_SETS CHARACTER_SETS DEFAULT_COLLATE_NAME Default collation 253 96 15 N 1 0 33
+def information_schema CHARACTER_SETS CHARACTER_SETS MAXLEN Maxlen 8 3 1 N 32769 0 63
Charset Description Default collation Maxlen
utf8 UTF-8 Unicode utf8_general_ci 3
----------------------------------------------------------------
SHOW COLLATION LIKE 'latin1_bin';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
-def COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
-def COLLATIONS ID Id 8 11 2 N 32769 0 63
-def COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
-def COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
-def COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63
+def information_schema COLLATIONS COLLATIONS COLLATION_NAME Collation 253 96 10 N 1 0 33
+def information_schema COLLATIONS COLLATIONS CHARACTER_SET_NAME Charset 253 96 6 N 1 0 33
+def information_schema COLLATIONS COLLATIONS ID Id 8 11 2 N 32769 0 63
+def information_schema COLLATIONS COLLATIONS IS_DEFAULT Default 253 9 0 N 1 0 33
+def information_schema COLLATIONS COLLATIONS IS_COMPILED Compiled 253 9 3 N 1 0 33
+def information_schema COLLATIONS COLLATIONS SORTLEN Sortlen 8 3 1 N 32769 0 63
Collation Charset Id Default Compiled Sortlen
latin1_bin latin1 47 Yes 1
----------------------------------------------------------------
@@ -886,7 +885,7 @@ mysqltest1 CREATE DATABASE `mysqltest1` /*!40100 DEFAULT CHARACTER SET latin1 */
----------------------------------------------------------------
SHOW DATABASES LIKE 'mysqltest1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33
+def information_schema SCHEMATA SCHEMATA SCHEMA_NAME Database (mysqltest1) 253 192 10 N 1 0 33
Database (mysqltest1)
mysqltest1
----------------------------------------------------------------
@@ -902,18 +901,18 @@ t1 CREATE TABLE `t1` (
----------------------------------------------------------------
SHOW INDEX FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33
-def STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
-def STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33
-def STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
-def STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33
-def STATISTICS COLLATION Collation 253 3 1 Y 0 0 33
-def STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
-def STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
-def STATISTICS PACKED Packed 253 30 0 Y 0 0 33
-def STATISTICS NULLABLE Null 253 9 0 N 1 0 33
-def STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33
-def STATISTICS COMMENT Comment 253 48 0 Y 0 0 33
+def information_schema STATISTICS STATISTICS TABLE_NAME Table 253 192 2 N 1 0 33
+def information_schema STATISTICS STATISTICS NON_UNIQUE Non_unique 8 1 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS INDEX_NAME Key_name 253 192 7 N 1 0 33
+def information_schema STATISTICS STATISTICS SEQ_IN_INDEX Seq_in_index 8 2 1 N 32769 0 63
+def information_schema STATISTICS STATISTICS COLUMN_NAME Column_name 253 192 1 N 1 0 33
+def information_schema STATISTICS STATISTICS COLLATION Collation 253 3 1 Y 0 0 33
+def information_schema STATISTICS STATISTICS CARDINALITY Cardinality 8 21 1 Y 32768 0 63
+def information_schema STATISTICS STATISTICS SUB_PART Sub_part 8 3 0 Y 32768 0 63
+def information_schema STATISTICS STATISTICS PACKED Packed 253 30 0 Y 0 0 33
+def information_schema STATISTICS STATISTICS NULLABLE Null 253 9 0 N 1 0 33
+def information_schema STATISTICS STATISTICS INDEX_TYPE Index_type 253 48 5 N 1 0 33
+def information_schema STATISTICS STATISTICS COMMENT Comment 253 48 0 Y 0 0 33
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 c A 0 NULL NULL BTREE
----------------------------------------------------------------
@@ -930,17 +929,17 @@ TABLE_COMMENT
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name = 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
-def TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
-def TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
-def TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
-def TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
-def TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
-def TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
-def TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
-def TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
+def information_schema TABLES TABLES TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
+def information_schema TABLES TABLES TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
+def information_schema TABLES TABLES TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
+def information_schema TABLES TABLES TABLE_TYPE TABLE_TYPE 253 192 10 N 1 0 33
+def information_schema TABLES TABLES ENGINE ENGINE 253 192 6 Y 0 0 33
+def information_schema TABLES TABLES ROW_FORMAT ROW_FORMAT 253 30 5 Y 0 0 33
+def information_schema TABLES TABLES TABLE_COLLATION TABLE_COLLATION 253 96 17 Y 0 0 33
+def information_schema TABLES TABLES CREATE_OPTIONS CREATE_OPTIONS 253 765 0 Y 0 0 33
+def information_schema TABLES TABLES TABLE_COMMENT TABLE_COMMENT 253 240 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE ROW_FORMAT TABLE_COLLATION CREATE_OPTIONS TABLE_COMMENT
-NULL test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
+def test t1 BASE TABLE MyISAM Fixed latin1_swedish_ci
----------------------------------------------------------------
SELECT
TABLE_CATALOG,
@@ -960,53 +959,53 @@ COLUMN_COMMENT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
-def COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
-def COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
-def COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
-def COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
-def COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
-def COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
-def COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
-def COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
-def COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
-def COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
-def COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
-def COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33
-def COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33
+def information_schema COLUMNS COLUMNS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
+def information_schema COLUMNS COLUMNS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
+def information_schema COLUMNS COLUMNS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_NAME COLUMN_NAME 253 192 1 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_DEFAULT COLUMN_DEFAULT 252 589815 0 Y 16 0 33
+def information_schema COLUMNS COLUMNS IS_NULLABLE IS_NULLABLE 253 9 2 N 1 0 33
+def information_schema COLUMNS COLUMNS DATA_TYPE DATA_TYPE 253 192 3 N 1 0 33
+def information_schema COLUMNS COLUMNS CHARACTER_SET_NAME CHARACTER_SET_NAME 253 96 0 Y 0 0 33
+def information_schema COLUMNS COLUMNS COLLATION_NAME COLLATION_NAME 253 96 0 Y 0 0 33
+def information_schema COLUMNS COLUMNS COLUMN_TYPE COLUMN_TYPE 252 589815 7 N 17 0 33
+def information_schema COLUMNS COLUMNS COLUMN_KEY COLUMN_KEY 253 9 3 N 1 0 33
+def information_schema COLUMNS COLUMNS EXTRA EXTRA 253 81 0 N 1 0 33
+def information_schema COLUMNS COLUMNS PRIVILEGES PRIVILEGES 253 240 31 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_COMMENT COLUMN_COMMENT 253 765 0 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME COLUMN_DEFAULT IS_NULLABLE DATA_TYPE CHARACTER_SET_NAME COLLATION_NAME COLUMN_TYPE COLUMN_KEY EXTRA PRIVILEGES COLUMN_COMMENT
-NULL test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references
+def test t1 c NULL NO int NULL NULL int(11) PRI select,insert,update,references
----------------------------------------------------------------
SHOW TABLES LIKE 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33
+def information_schema TABLE_NAMES TABLE_NAMES TABLE_NAME Tables_in_test (t1) 253 192 2 N 1 0 33
Tables_in_test (t1)
t1
----------------------------------------------------------------
SHOW COLUMNS FROM t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33
-def COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
-def COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
-def COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
-def COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
-def COLUMNS EXTRA Extra 253 81 0 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_NAME Field 253 192 1 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_TYPE Type 252 589815 7 N 17 0 33
+def information_schema COLUMNS COLUMNS IS_NULLABLE Null 253 9 2 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_KEY Key 253 9 3 N 1 0 33
+def information_schema COLUMNS COLUMNS COLUMN_DEFAULT Default 252 589815 0 Y 16 0 33
+def information_schema COLUMNS COLUMNS EXTRA Extra 253 81 0 N 1 0 33
Field Type Null Key Default Extra
c int(11) NO PRI NULL
----------------------------------------------------------------
SHOW TRIGGERS LIKE 't1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33
-def TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33
-def TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
-def TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
-def TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
-def TRIGGERS CREATED Created 12 19 0 Y 128 0 63
-def TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
-def TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
-def TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
-def TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
-def TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_NAME Trigger 253 192 5 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION Event 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE Table 253 192 2 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT Statement 252 589815 10 N 17 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_TIMING Timing 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS CREATED Created 12 19 0 Y 128 0 63
+def information_schema TRIGGERS TRIGGERS SQL_MODE sql_mode 253 24576 0 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DEFINER Definer 253 231 14 N 1 0 33
+def information_schema TRIGGERS TRIGGERS CHARACTER_SET_CLIENT character_set_client 253 96 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS COLLATION_CONNECTION collation_connection 253 96 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DATABASE_COLLATION Database Collation 253 96 17 N 1 0 33
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
t1_bi INSERT t1 SET @a = 1 BEFORE NULL root@localhost binary binary latin1_swedish_ci
----------------------------------------------------------------
@@ -1031,25 +1030,25 @@ DEFINER
FROM INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_name = 't1_bi';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 0 Y 0 0 33
-def TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33
-def TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33
-def TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33
-def TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 0 Y 0 0 33
-def TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33
-def TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33
-def TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33
-def TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33
-def TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33
-def TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33
-def TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33
-def TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
-def TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
-def TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
-def TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
-def TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_CATALOG TRIGGER_CATALOG 253 1536 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_SCHEMA TRIGGER_SCHEMA 253 192 4 N 1 0 33
+def information_schema TRIGGERS TRIGGERS TRIGGER_NAME TRIGGER_NAME 253 192 5 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_MANIPULATION EVENT_MANIPULATION 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_CATALOG EVENT_OBJECT_CATALOG 253 1536 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_SCHEMA EVENT_OBJECT_SCHEMA 253 192 4 N 1 0 33
+def information_schema TRIGGERS TRIGGERS EVENT_OBJECT_TABLE EVENT_OBJECT_TABLE 253 192 2 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_CONDITION ACTION_CONDITION 252 589815 0 Y 16 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_STATEMENT ACTION_STATEMENT 252 589815 10 N 17 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_ORIENTATION ACTION_ORIENTATION 253 27 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_TIMING ACTION_TIMING 253 18 6 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_OLD_TABLE 253 192 0 Y 0 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_NEW_TABLE 253 192 0 Y 0 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_OLD_ROW 253 9 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS ACTION_REFERENCE_NEW_ROW ACTION_REFERENCE_NEW_ROW 253 9 3 N 1 0 33
+def information_schema TRIGGERS TRIGGERS SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema TRIGGERS TRIGGERS DEFINER DEFINER 253 231 14 N 1 0 33
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW SQL_MODE DEFINER
-NULL test t1_bi INSERT NULL test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
+def test t1_bi INSERT def test t1 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW root@localhost
----------------------------------------------------------------
SHOW CREATE VIEW v1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1064,18 +1063,18 @@ SELECT *
FROM INFORMATION_SCHEMA.VIEWS
WHERE table_name = 'v1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 0 Y 0 0 33
-def VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
-def VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
-def VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33
-def VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33
-def VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33
-def VIEWS DEFINER DEFINER 253 231 14 N 1 0 33
-def VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
-def VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
+def information_schema VIEWS VIEWS TABLE_CATALOG TABLE_CATALOG 253 1536 3 N 1 0 33
+def information_schema VIEWS VIEWS TABLE_SCHEMA TABLE_SCHEMA 253 192 4 N 1 0 33
+def information_schema VIEWS VIEWS TABLE_NAME TABLE_NAME 253 192 2 N 1 0 33
+def information_schema VIEWS VIEWS VIEW_DEFINITION VIEW_DEFINITION 252 589815 15 N 17 0 33
+def information_schema VIEWS VIEWS CHECK_OPTION CHECK_OPTION 253 24 4 N 1 0 33
+def information_schema VIEWS VIEWS IS_UPDATABLE IS_UPDATABLE 253 9 2 N 1 0 33
+def information_schema VIEWS VIEWS DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema VIEWS VIEWS SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
+def information_schema VIEWS VIEWS CHARACTER_SET_CLIENT CHARACTER_SET_CLIENT 253 96 6 N 1 0 33
+def information_schema VIEWS VIEWS COLLATION_CONNECTION COLLATION_CONNECTION 253 96 6 N 1 0 33
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION
-NULL test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
+def test v1 select 1 AS `1` NONE NO root@localhost DEFINER binary binary
----------------------------------------------------------------
SHOW CREATE PROCEDURE p1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1111,26 +1110,26 @@ DEFINER
FROM INFORMATION_SCHEMA.ROUTINES
WHERE routine_name = 'p1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33
-def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
-def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33
-def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33
-def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
-def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
-def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
-def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
-def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
-def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
-def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
-def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
-def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
-def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
-def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 9 N 1 0 33
+def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
+def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
-p1 NULL test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
+p1 def test p1 PROCEDURE NULL SQL SELECT 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
----------------------------------------------------------------
SHOW CREATE FUNCTION f1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
@@ -1166,26 +1165,26 @@ DEFINER
FROM INFORMATION_SCHEMA.ROUTINES
WHERE routine_name = 'f1';
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 0 Y 0 0 33
-def ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
-def ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
-def ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33
-def ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33
-def ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
-def ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
-def ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
-def ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
-def ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
-def ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
-def ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
-def ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
-def ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
-def ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
-def ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 253 192 0 N 1 0 33
-def ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
+def information_schema ROUTINES ROUTINES SPECIFIC_NAME SPECIFIC_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_CATALOG ROUTINE_CATALOG 253 1536 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_SCHEMA ROUTINE_SCHEMA 253 192 4 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_NAME ROUTINE_NAME 253 192 2 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_TYPE ROUTINE_TYPE 253 27 8 N 1 0 33
+def information_schema ROUTINES ROUTINES DTD_IDENTIFIER DTD_IDENTIFIER 253 192 7 Y 0 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_BODY ROUTINE_BODY 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_DEFINITION ROUTINE_DEFINITION 252 589815 8 Y 16 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_NAME EXTERNAL_NAME 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES EXTERNAL_LANGUAGE EXTERNAL_LANGUAGE 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES PARAMETER_STYLE PARAMETER_STYLE 253 24 3 N 1 0 33
+def information_schema ROUTINES ROUTINES IS_DETERMINISTIC IS_DETERMINISTIC 253 9 2 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_DATA_ACCESS SQL_DATA_ACCESS 253 192 12 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_PATH SQL_PATH 253 192 0 Y 0 0 33
+def information_schema ROUTINES ROUTINES SECURITY_TYPE SECURITY_TYPE 253 21 7 N 1 0 33
+def information_schema ROUTINES ROUTINES SQL_MODE SQL_MODE 253 24576 0 N 1 0 33
+def information_schema ROUTINES ROUTINES ROUTINE_COMMENT ROUTINE_COMMENT 252 589815 0 N 17 0 33
+def information_schema ROUTINES ROUTINES DEFINER DEFINER 253 231 14 N 1 0 33
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE SQL_MODE ROUTINE_COMMENT DEFINER
-f1 NULL test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
+f1 def test f1 FUNCTION int(11) SQL RETURN 1 NULL NULL SQL NO CONTAINS SQL NULL DEFINER root@localhost
----------------------------------------------------------------
DROP DATABASE mysqltest1;
DROP TABLE t1;
@@ -1442,7 +1441,7 @@ FOR EACH ROW
SET NEW.c1 = 'тест' koi8r koi8r_general_ci latin1_swedish_ci
SHOW CREATE EVENT ev1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
-ev1 SYSTEM CREATE EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'тест' AS test koi8r koi8r_general_ci latin1_swedish_ci
+ev1 SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `ev1` ON SCHEDULE AT '2030-01-01 00:00:00' ON COMPLETION NOT PRESERVE ENABLE DO SELECT 'тест' AS test koi8r koi8r_general_ci latin1_swedish_ci
DROP VIEW v1;
DROP PROCEDURE p1;
DROP FUNCTION f1;
diff --git a/mysql-test/r/signal.result b/mysql-test/r/signal.result
new file mode 100644
index 00000000000..7fb09b87778
--- /dev/null
+++ b/mysql-test/r/signal.result
@@ -0,0 +1,2362 @@
+#
+# PART 1: syntax
+#
+#
+# Test every new reserved and non reserved keywords
+#
+drop table if exists signal_non_reserved;
+create table signal_non_reserved (
+class_origin int,
+subclass_origin int,
+constraint_catalog int,
+constraint_schema int,
+constraint_name int,
+catalog_name int,
+schema_name int,
+table_name int,
+column_name int,
+cursor_name int,
+message_text int,
+sqlcode int
+);
+drop table signal_non_reserved;
+drop table if exists diag_non_reserved;
+create table diag_non_reserved (
+diagnostics int,
+current int,
+stacked int,
+exception int
+);
+drop table diag_non_reserved;
+drop table if exists diag_cond_non_reserved;
+create table diag_cond_non_reserved (
+condition_identifier int,
+condition_number int,
+condition_name int,
+connection_name int,
+message_length int,
+message_octet_length int,
+parameter_mode int,
+parameter_name int,
+parameter_ordinal_position int,
+returned_sqlstate int,
+routine_catalog int,
+routine_name int,
+routine_schema int,
+server_name int,
+specific_name int,
+trigger_catalog int,
+trigger_name int,
+trigger_schema int
+);
+drop table diag_cond_non_reserved;
+drop table if exists diag_stmt_non_reserved;
+create table diag_stmt_non_reserved (
+number int,
+more int,
+command_function int,
+command_function_code int,
+dynamic_function int,
+dynamic_function_code int,
+row_count int,
+transactions_committed int,
+transactions_rolled_back int,
+transaction_active int
+);
+drop table diag_stmt_non_reserved;
+drop table if exists test_reserved;
+create table test_reserved (signal int);
+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 'signal int)' at line 1
+create table test_reserved (resignal int);
+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 'resignal int)' at line 1
+create table test_reserved (condition int);
+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 'condition int)' at line 1
+#
+# Test the SIGNAL syntax
+#
+drop procedure if exists test_invalid;
+drop procedure if exists test_signal_syntax;
+drop function if exists test_signal_func;
+create procedure test_invalid()
+begin
+SIGNAL;
+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 ';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL foo;
+end $$
+ERROR 42000: Undefined CONDITION: foo
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR 1234;
+SIGNAL foo;
+end $$
+ERROR HY000: SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo;
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+SIGNAL SQLSTATE '23000';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+SIGNAL SQLSTATE VALUE '23000';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET SUBCLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CONSTRAINT_CATALOG = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CONSTRAINT_SCHEMA = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CONSTRAINT_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CATALOG_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET SCHEMA_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET TABLE_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET COLUMN_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CURSOR_NAME = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'CLASS_ORIGIN'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MESSAGE_TEXT'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MYSQL_ERRNO'
+create procedure test_signal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET
+CLASS_ORIGIN = 'foo',
+SUBCLASS_ORIGIN = 'foo',
+CONSTRAINT_CATALOG = 'foo',
+CONSTRAINT_SCHEMA = 'foo',
+CONSTRAINT_NAME = 'foo',
+CATALOG_NAME = 'foo',
+SCHEMA_NAME = 'foo',
+TABLE_NAME = 'foo',
+COLUMN_NAME = 'foo',
+CURSOR_NAME = 'foo',
+MESSAGE_TEXT = 'foo',
+MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_signal_syntax $$
+SIGNAL SQLSTATE '00000' $$
+ERROR 42000: Bad SQLSTATE: '00000'
+SIGNAL SQLSTATE '00001' $$
+ERROR 42000: Bad SQLSTATE: '00001'
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '00000';
+end $$
+ERROR 42000: Bad SQLSTATE: '00000'
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '00001';
+end $$
+ERROR 42000: Bad SQLSTATE: '00001'
+#
+# Test conditions information that SIGNAL can not set
+#
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET bla_bla = 'foo';
+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 'bla_bla = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET CONDITION_IDENTIFIER = 'foo';
+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 'CONDITION_IDENTIFIER = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET CONDITION_NUMBER = 'foo';
+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 'CONDITION_NUMBER = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET CONNECTION_NAME = 'foo';
+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 'CONNECTION_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET MESSAGE_LENGTH = 'foo';
+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 'MESSAGE_LENGTH = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET MESSAGE_OCTET_LENGTH = 'foo';
+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 'MESSAGE_OCTET_LENGTH = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET PARAMETER_MODE = 'foo';
+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 'PARAMETER_MODE = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET PARAMETER_NAME = 'foo';
+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 'PARAMETER_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET PARAMETER_ORDINAL_POSITION = 'foo';
+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 'PARAMETER_ORDINAL_POSITION = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET RETURNED_SQLSTATE = 'foo';
+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 'RETURNED_SQLSTATE = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET ROUTINE_CATALOG = 'foo';
+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 'ROUTINE_CATALOG = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET ROUTINE_NAME = 'foo';
+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 'ROUTINE_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET ROUTINE_SCHEMA = 'foo';
+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 'ROUTINE_SCHEMA = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET SERVER_NAME = 'foo';
+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 'SERVER_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET SPECIFIC_NAME = 'foo';
+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 'SPECIFIC_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET TRIGGER_CATALOG = 'foo';
+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 'TRIGGER_CATALOG = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET TRIGGER_NAME = 'foo';
+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 'TRIGGER_NAME = 'foo';
+end' at line 3
+create procedure test_invalid()
+begin
+SIGNAL SQLSTATE '12345' SET TRIGGER_SCHEMA = 'foo';
+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 'TRIGGER_SCHEMA = 'foo';
+end' at line 3
+#
+# Test the RESIGNAL syntax
+#
+drop procedure if exists test_invalid;
+drop procedure if exists test_resignal_syntax;
+create procedure test_invalid()
+begin
+RESIGNAL foo;
+end $$
+ERROR 42000: Undefined CONDITION: foo
+create procedure test_resignal_syntax()
+begin
+RESIGNAL;
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR 1234;
+RESIGNAL foo;
+end $$
+ERROR HY000: SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo;
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SQLSTATE '23000';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SQLSTATE VALUE '23000';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET SUBCLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET SUBCLASS_ORIGIN = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CONSTRAINT_CATALOG = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CONSTRAINT_CATALOG = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CONSTRAINT_SCHEMA = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CONSTRAINT_SCHEMA = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CONSTRAINT_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CONSTRAINT_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CATALOG_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CATALOG_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET SCHEMA_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET SCHEMA_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET TABLE_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET TABLE_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET COLUMN_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET COLUMN_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET CURSOR_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CURSOR_NAME = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+RESIGNAL SET MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MYSQL_ERRNO = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET CLASS_ORIGIN = 'foo', CLASS_ORIGIN = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'CLASS_ORIGIN'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MESSAGE_TEXT = 'foo', MESSAGE_TEXT = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MESSAGE_TEXT'
+create procedure test_invalid()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET MYSQL_ERRNO = 'foo', MYSQL_ERRNO = 'bar';
+end $$
+ERROR 42000: Duplicate condition information item 'MYSQL_ERRNO'
+create procedure test_resignal_syntax()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+RESIGNAL foo SET
+CLASS_ORIGIN = 'foo',
+SUBCLASS_ORIGIN = 'foo',
+CONSTRAINT_CATALOG = 'foo',
+CONSTRAINT_SCHEMA = 'foo',
+CONSTRAINT_NAME = 'foo',
+CATALOG_NAME = 'foo',
+SCHEMA_NAME = 'foo',
+TABLE_NAME = 'foo',
+COLUMN_NAME = 'foo',
+CURSOR_NAME = 'foo',
+MESSAGE_TEXT = 'foo';
+end $$
+drop procedure test_resignal_syntax $$
+create procedure test_invalid()
+begin
+RESIGNAL SQLSTATE '00000';
+end $$
+ERROR 42000: Bad SQLSTATE: '00000'
+create procedure test_invalid()
+begin
+RESIGNAL SQLSTATE '00001';
+end $$
+ERROR 42000: Bad SQLSTATE: '00001'
+#
+# PART 2: non preparable statements
+#
+prepare stmt from 'SIGNAL SQLSTATE \'23000\'';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+prepare stmt from 'RESIGNAL SQLSTATE \'23000\'';
+ERROR HY000: This command is not supported in the prepared statement protocol yet
+#
+# PART 3: runtime execution
+#
+drop procedure if exists test_signal;
+drop procedure if exists test_resignal;
+drop table if exists t_warn;
+drop table if exists t_cursor;
+create table t_warn(a integer(2));
+create table t_cursor(a integer);
+#
+# SIGNAL can also appear in a query
+#
+SIGNAL foo;
+ERROR 42000: Undefined CONDITION: foo
+SIGNAL SQLSTATE '01000';
+Warnings:
+Warning 1642 Unhandled user-defined warning condition
+SIGNAL SQLSTATE '02000';
+ERROR 02000: Unhandled user-defined not found condition
+SIGNAL SQLSTATE '23000';
+ERROR 23000: Unhandled user-defined exception condition
+SIGNAL SQLSTATE VALUE '23000';
+ERROR 23000: Unhandled user-defined exception condition
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 65536;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '65536'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 99999;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '99999'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 4294967295;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '4294967295'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 0;
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '0'
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = -1;
+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 '-1' at line 1
+SIGNAL SQLSTATE 'HY000' SET MYSQL_ERRNO = 65535;
+ERROR HY000: Unhandled user-defined exception condition
+#
+# RESIGNAL can also appear in a query
+#
+RESIGNAL;
+ERROR 0K000: RESIGNAL when handler not active
+RESIGNAL foo;
+ERROR 42000: Undefined CONDITION: foo
+RESIGNAL SQLSTATE '12345';
+ERROR 0K000: RESIGNAL when handler not active
+RESIGNAL SQLSTATE VALUE '12345';
+ERROR 0K000: RESIGNAL when handler not active
+#
+# Different kind of SIGNAL conditions
+#
+create procedure test_signal()
+begin
+# max range
+DECLARE foo CONDITION FOR SQLSTATE 'AABBB';
+SIGNAL foo SET MYSQL_ERRNO = 65535;
+end $$
+call test_signal() $$
+ERROR AABBB: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# max range
+DECLARE foo CONDITION FOR SQLSTATE 'AABBB';
+SIGNAL foo SET MYSQL_ERRNO = 65536;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '65536'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+SIGNAL foo SET MYSQL_ERRNO = 9999;
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# warning
+DECLARE too_few_records CONDITION FOR SQLSTATE '01000';
+SIGNAL too_few_records SET MYSQL_ERRNO = 1261;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1261 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Not found
+DECLARE sp_fetch_no_data CONDITION FOR SQLSTATE '02000';
+SIGNAL sp_fetch_no_data SET MYSQL_ERRNO = 1329;
+end $$
+call test_signal() $$
+ERROR 02000: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error
+DECLARE sp_cursor_already_open CONDITION FOR SQLSTATE '24000';
+SIGNAL sp_cursor_already_open SET MYSQL_ERRNO = 1325;
+end $$
+call test_signal() $$
+ERROR 24000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Severe error
+DECLARE lock_deadlock CONDITION FOR SQLSTATE '40001';
+SIGNAL lock_deadlock SET MYSQL_ERRNO = 1213;
+end $$
+call test_signal() $$
+ERROR 40001: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Unknown -> error
+DECLARE foo CONDITION FOR SQLSTATE "99999";
+SIGNAL foo;
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# warning, no subclass
+DECLARE warn CONDITION FOR SQLSTATE "01000";
+SIGNAL warn;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# warning, with subclass
+DECLARE warn CONDITION FOR SQLSTATE "01123";
+SIGNAL warn;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Not found, no subclass
+DECLARE not_found CONDITION FOR SQLSTATE "02000";
+SIGNAL not_found;
+end $$
+call test_signal() $$
+ERROR 02000: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Not found, with subclass
+DECLARE not_found CONDITION FOR SQLSTATE "02XXX";
+SIGNAL not_found;
+end $$
+call test_signal() $$
+ERROR 02XXX: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error, no subclass
+DECLARE error CONDITION FOR SQLSTATE "12000";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 12000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Error, with subclass
+DECLARE error CONDITION FOR SQLSTATE "12ABC";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 12ABC: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Severe error, no subclass
+DECLARE error CONDITION FOR SQLSTATE "40000";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 40000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+# Severe error, with subclass
+DECLARE error CONDITION FOR SQLSTATE "40001";
+SIGNAL error;
+end $$
+call test_signal() $$
+ERROR 40001: Unhandled user-defined exception condition
+drop procedure test_signal $$
+#
+# Test the scope of condition
+#
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+begin
+DECLARE foo CONDITION FOR 8888;
+end;
+SIGNAL foo SET MYSQL_ERRNO=9999; /* outer */
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR 9999;
+begin
+DECLARE foo CONDITION FOR SQLSTATE '88888';
+SIGNAL foo SET MYSQL_ERRNO=8888; /* inner */
+end;
+end $$
+call test_signal() $$
+ERROR 88888: Unhandled user-defined exception condition
+drop procedure test_signal $$
+#
+# Test SET MYSQL_ERRNO
+#
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+SIGNAL foo SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+ERROR 99999: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01000";
+SIGNAL warn SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1111 Unhandled user-defined warning condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02000";
+SIGNAL not_found SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+ERROR 02000: Unhandled user-defined not found condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55000";
+SIGNAL error SET MYSQL_ERRNO = 1111;
+end $$
+call test_signal() $$
+ERROR 55000: Unhandled user-defined exception condition
+drop procedure test_signal $$
+#
+# Test SET MESSAGE_TEXT
+#
+SIGNAL SQLSTATE '77777' SET MESSAGE_TEXT='' $$
+ERROR 77777:
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '77777';
+SIGNAL foo SET
+MESSAGE_TEXT = "",
+MYSQL_ERRNO=5678;
+end $$
+call test_signal() $$
+ERROR 77777:
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '99999';
+SIGNAL foo SET
+MESSAGE_TEXT = "Something bad happened",
+MYSQL_ERRNO=9999;
+end $$
+call test_signal() $$
+ERROR 99999: Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01000";
+SIGNAL warn SET MESSAGE_TEXT = "Something bad happened";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02000";
+SIGNAL not_found SET MESSAGE_TEXT = "Something bad happened";
+end $$
+call test_signal() $$
+ERROR 02000: Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55000";
+SIGNAL error SET MESSAGE_TEXT = "Something bad happened";
+end $$
+call test_signal() $$
+ERROR 55000: Something bad happened
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE "01000";
+SIGNAL something SET MESSAGE_TEXT = _utf8 "This is a UTF8 text";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 This is a UTF8 text
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE "01000";
+SIGNAL something SET MESSAGE_TEXT = "";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+SIGNAL warn SET MESSAGE_TEXT = "á a";
+end $$
+call test_signal() $$
+Warnings:
+Warning 1642 á a
+show warnings $$
+Level Code Message
+Warning 1642 á a
+drop procedure test_signal $$
+#
+# Test SET complex expressions
+#
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+MYSQL_ERRNO = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CLASS_ORIGIN = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CLASS_ORIGIN' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+SUBCLASS_ORIGIN = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'SUBCLASS_ORIGIN' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CONSTRAINT_CATALOG = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CONSTRAINT_CATALOG' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CONSTRAINT_SCHEMA = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CONSTRAINT_SCHEMA' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CONSTRAINT_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CONSTRAINT_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CATALOG_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CATALOG_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+SCHEMA_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'SCHEMA_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+TABLE_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'TABLE_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+COLUMN_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'COLUMN_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+CURSOR_NAME = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'CURSOR_NAME' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE '99999';
+SIGNAL error SET
+MESSAGE_TEXT = NULL;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE '99999';
+DECLARE message_text VARCHAR(64) DEFAULT "Local string variable";
+DECLARE sqlcode INTEGER DEFAULT 1234;
+SIGNAL something SET
+MESSAGE_TEXT = message_text,
+MYSQL_ERRNO = sqlcode;
+end $$
+call test_signal() $$
+ERROR 99999: Local string variable
+drop procedure test_signal $$
+create procedure test_signal(message_text VARCHAR(64), sqlcode INTEGER)
+begin
+DECLARE something CONDITION FOR SQLSTATE "12345";
+SIGNAL something SET
+MESSAGE_TEXT = message_text,
+MYSQL_ERRNO = sqlcode;
+end $$
+call test_signal("Parameter string", NULL) $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'NULL'
+call test_signal(NULL, 1234) $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+call test_signal("Parameter string", 5678) $$
+ERROR 12345: Parameter string
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE something CONDITION FOR SQLSTATE "AABBB";
+SIGNAL something SET
+MESSAGE_TEXT = @message_text,
+MYSQL_ERRNO = @sqlcode;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+set @sqlcode= 12 $$
+call test_signal() $$
+ERROR 42000: Variable 'MESSAGE_TEXT' can't be set to the value of 'NULL'
+set @message_text= "User variable" $$
+call test_signal() $$
+ERROR AABBB: User variable
+drop procedure test_signal $$
+create procedure test_invalid()
+begin
+DECLARE something CONDITION FOR SQLSTATE "AABBB";
+SIGNAL something SET
+MESSAGE_TEXT = @message_text := 'illegal',
+MYSQL_ERRNO = @sqlcode := 1234;
+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 '
+MYSQL_ERRNO = @sqlcode := 1234;
+end' at line 5
+create procedure test_signal()
+begin
+DECLARE aaa VARCHAR(64);
+DECLARE bbb VARCHAR(64);
+DECLARE ccc VARCHAR(64);
+DECLARE ddd VARCHAR(64);
+DECLARE eee VARCHAR(64);
+DECLARE fff VARCHAR(64);
+DECLARE ggg VARCHAR(64);
+DECLARE hhh VARCHAR(64);
+DECLARE iii VARCHAR(64);
+DECLARE jjj VARCHAR(64);
+DECLARE kkk VARCHAR(64);
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+set aaa= repeat("A", 64);
+set bbb= repeat("B", 64);
+set ccc= repeat("C", 64);
+set ddd= repeat("D", 64);
+set eee= repeat("E", 64);
+set fff= repeat("F", 64);
+set ggg= repeat("G", 64);
+set hhh= repeat("H", 64);
+set iii= repeat("I", 64);
+set jjj= repeat("J", 64);
+set kkk= repeat("K", 64);
+SIGNAL warn SET
+CLASS_ORIGIN = aaa,
+SUBCLASS_ORIGIN = bbb,
+CONSTRAINT_CATALOG = ccc,
+CONSTRAINT_SCHEMA = ddd,
+CONSTRAINT_NAME = eee,
+CATALOG_NAME = fff,
+SCHEMA_NAME = ggg,
+TABLE_NAME = hhh,
+COLUMN_NAME = iii,
+CURSOR_NAME = jjj,
+MESSAGE_TEXT = kkk,
+MYSQL_ERRNO = 65535;
+end $$
+call test_signal() $$
+Warnings:
+Warning 65535 KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+SIGNAL warn SET
+MYSQL_ERRNO = 999999999999999999999999999999999999999999999999999;
+end $$
+call test_signal() $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of '999999999999999999999999999999999999999999999999999'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE aaax VARCHAR(65);
+DECLARE bbbx VARCHAR(65);
+DECLARE cccx VARCHAR(65);
+DECLARE dddx VARCHAR(65);
+DECLARE eeex VARCHAR(65);
+DECLARE fffx VARCHAR(65);
+DECLARE gggx VARCHAR(65);
+DECLARE hhhx VARCHAR(65);
+DECLARE iiix VARCHAR(65);
+DECLARE jjjx VARCHAR(65);
+DECLARE kkkx VARCHAR(65);
+DECLARE lllx VARCHAR(129);
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+set aaax= concat(repeat("A", 64), "X");
+set bbbx= concat(repeat("B", 64), "X");
+set cccx= concat(repeat("C", 64), "X");
+set dddx= concat(repeat("D", 64), "X");
+set eeex= concat(repeat("E", 64), "X");
+set fffx= concat(repeat("F", 64), "X");
+set gggx= concat(repeat("G", 64), "X");
+set hhhx= concat(repeat("H", 64), "X");
+set iiix= concat(repeat("I", 64), "X");
+set jjjx= concat(repeat("J", 64), "X");
+set kkkx= concat(repeat("K", 64), "X");
+set lllx= concat(repeat("1", 100),
+repeat("2", 20),
+repeat("8", 8),
+"X");
+SIGNAL warn SET
+CLASS_ORIGIN = aaax,
+SUBCLASS_ORIGIN = bbbx,
+CONSTRAINT_CATALOG = cccx,
+CONSTRAINT_SCHEMA = dddx,
+CONSTRAINT_NAME = eeex,
+CATALOG_NAME = fffx,
+SCHEMA_NAME = gggx,
+TABLE_NAME = hhhx,
+COLUMN_NAME = iiix,
+CURSOR_NAME = jjjx,
+MESSAGE_TEXT = lllx,
+MYSQL_ERRNO = 10000;
+end $$
+call test_signal() $$
+Warnings:
+Warning 1647 Data truncated for condition item 'CLASS_ORIGIN'
+Warning 1647 Data truncated for condition item 'SUBCLASS_ORIGIN'
+Warning 1647 Data truncated for condition item 'CONSTRAINT_CATALOG'
+Warning 1647 Data truncated for condition item 'CONSTRAINT_SCHEMA'
+Warning 1647 Data truncated for condition item 'CONSTRAINT_NAME'
+Warning 1647 Data truncated for condition item 'CATALOG_NAME'
+Warning 1647 Data truncated for condition item 'SCHEMA_NAME'
+Warning 1647 Data truncated for condition item 'TABLE_NAME'
+Warning 1647 Data truncated for condition item 'COLUMN_NAME'
+Warning 1647 Data truncated for condition item 'CURSOR_NAME'
+Warning 1647 Data truncated for condition item 'MESSAGE_TEXT'
+Warning 10000 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111112222222222222222222288888888
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for SQLSTATE "01234"
+ begin
+select "Caught by SQLSTATE";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLSTATE
+Caught by SQLSTATE
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "Caught by number";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by number
+Caught by number
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for SQLWARNING
+begin
+select "Caught by SQLWARNING";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLWARNING
+Caught by SQLWARNING
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for SQLSTATE "02ABC"
+ begin
+select "Caught by SQLSTATE";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLSTATE
+Caught by SQLSTATE
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "Caught by number";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by number
+Caught by number
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for NOT FOUND
+begin
+select "Caught by NOT FOUND";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by NOT FOUND
+Caught by NOT FOUND
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for SQLSTATE "55555"
+ begin
+select "Caught by SQLSTATE";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLSTATE
+Caught by SQLSTATE
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "Caught by number";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by number
+Caught by number
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for SQLEXCEPTION
+begin
+select "Caught by SQLEXCEPTION";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_signal() $$
+Caught by SQLEXCEPTION
+Caught by SQLEXCEPTION
+drop procedure test_signal $$
+#
+# Test where SIGNAL can be used
+#
+create function test_signal_func() returns integer
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01XXX";
+SIGNAL warn SET
+MESSAGE_TEXT = "This function SIGNAL a warning",
+MYSQL_ERRNO = 1012;
+return 5;
+end $$
+select test_signal_func() $$
+test_signal_func()
+5
+Warnings:
+Warning 1012 This function SIGNAL a warning
+drop function test_signal_func $$
+create function test_signal_func() returns integer
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02XXX";
+SIGNAL not_found SET
+MESSAGE_TEXT = "This function SIGNAL not found",
+MYSQL_ERRNO = 1012;
+return 5;
+end $$
+select test_signal_func() $$
+ERROR 02XXX: This function SIGNAL not found
+drop function test_signal_func $$
+create function test_signal_func() returns integer
+begin
+DECLARE error CONDITION FOR SQLSTATE "50000";
+SIGNAL error SET
+MESSAGE_TEXT = "This function SIGNAL an error",
+MYSQL_ERRNO = 1012;
+return 5;
+end $$
+select test_signal_func() $$
+ERROR 50000: This function SIGNAL an error
+drop function test_signal_func $$
+drop table if exists t1 $$
+create table t1 (a integer) $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE msg VARCHAR(128);
+DECLARE warn CONDITION FOR SQLSTATE "01XXX";
+set msg= concat("This trigger SIGNAL a warning, a=", NEW.a);
+SIGNAL warn SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 1012;
+end $$
+insert into t1 values (1), (2) $$
+Warnings:
+Warning 1012 This trigger SIGNAL a warning, a=1
+Warning 1012 This trigger SIGNAL a warning, a=2
+drop trigger t1_ai $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE msg VARCHAR(128);
+DECLARE not_found CONDITION FOR SQLSTATE "02XXX";
+set msg= concat("This trigger SIGNAL a not found, a=", NEW.a);
+SIGNAL not_found SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 1012;
+end $$
+insert into t1 values (3), (4) $$
+ERROR 02XXX: This trigger SIGNAL a not found, a=3
+drop trigger t1_ai $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE msg VARCHAR(128);
+DECLARE error CONDITION FOR SQLSTATE "03XXX";
+set msg= concat("This trigger SIGNAL an error, a=", NEW.a);
+SIGNAL error SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 1012;
+end $$
+insert into t1 values (5), (6) $$
+ERROR 03XXX: This trigger SIGNAL an error, a=5
+drop table t1 $$
+create table t1 (errno integer, msg varchar(128)) $$
+create trigger t1_ai after insert on t1 for each row
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01XXX";
+SIGNAL warn SET
+MESSAGE_TEXT = NEW.msg,
+MYSQL_ERRNO = NEW.errno;
+end $$
+insert into t1 set errno=1012, msg='Warning message 1 in trigger' $$
+Warnings:
+Warning 1012 Warning message 1 in trigger
+insert into t1 set errno=1013, msg='Warning message 2 in trigger' $$
+Warnings:
+Warning 1013 Warning message 2 in trigger
+drop table t1 $$
+drop table if exists t1 $$
+drop procedure if exists p1 $$
+drop function if exists f1 $$
+create table t1 (s1 int) $$
+insert into t1 values (1) $$
+create procedure p1()
+begin
+declare a int;
+declare c cursor for select f1() from t1;
+declare continue handler for sqlstate '03000'
+ select "caught 03000";
+declare continue handler for 1326
+select "caught cursor is not open";
+select "Before open";
+open c;
+select "Before fetch";
+fetch c into a;
+select "Before close";
+close c;
+end $$
+create function f1() returns int
+begin
+signal sqlstate '03000';
+return 5;
+end $$
+drop table t1 $$
+drop procedure p1 $$
+drop function f1 $$
+#
+# Test the RESIGNAL runtime
+#
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1012 Raising a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02222";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: Raising a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "55555";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 55555: Raising an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02000: No data - zero rows fetched, selected, or processed
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 42S02: Unknown table 'no_such_table'
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01234";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 5555 RESIGNAL of a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02111: RESIGNAL of a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "33333";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL of an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 5555 RESIGNAL of a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02000: RESIGNAL of not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SET
+MESSAGE_TEXT = "RESIGNAL of an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 42S02: RESIGNAL of an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01222" SET
+MESSAGE_TEXT = "RESIGNAL to warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1012 Raising a warning
+Warning 5555 RESIGNAL to warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02222" SET
+MESSAGE_TEXT = "RESIGNAL to not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: RESIGNAL to not found
+show warnings $$
+Level Code Message
+Warning 1012 Raising a warning
+Error 5555 RESIGNAL to not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE warn CONDITION FOR SQLSTATE "01111";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "33333" SET
+MESSAGE_TEXT = "RESIGNAL to error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL warn SET
+MESSAGE_TEXT = "Raising a warning",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL to error
+show warnings $$
+Level Code Message
+Warning 1012 Raising a warning
+Error 5555 RESIGNAL to error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01222" SET
+MESSAGE_TEXT = "RESIGNAL to warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1012 Raising a not found
+Warning 5555 RESIGNAL to warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02222" SET
+MESSAGE_TEXT = "RESIGNAL to not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: RESIGNAL to not found
+show warnings $$
+Level Code Message
+Error 1012 Raising a not found
+Error 5555 RESIGNAL to not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE not_found CONDITION FOR SQLSTATE "02ABC";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "33333" SET
+MESSAGE_TEXT = "RESIGNAL to error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL not_found SET
+MESSAGE_TEXT = "Raising a not found",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL to error
+show warnings $$
+Level Code Message
+Error 1012 Raising a not found
+Error 5555 RESIGNAL to error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "AAAAA";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01222" SET
+MESSAGE_TEXT = "RESIGNAL to warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1012 Raising an error
+Warning 5555 RESIGNAL to warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "AAAAA";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02222" SET
+MESSAGE_TEXT = "RESIGNAL to not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02222: RESIGNAL to not found
+show warnings $$
+Level Code Message
+Error 1012 Raising an error
+Error 5555 RESIGNAL to not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE error CONDITION FOR SQLSTATE "AAAAA";
+DECLARE CONTINUE HANDLER for 1012
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "33333" SET
+MESSAGE_TEXT = "RESIGNAL to error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+SIGNAL error SET
+MESSAGE_TEXT = "Raising an error",
+MYSQL_ERRNO = 1012;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 33333: RESIGNAL to error
+show warnings $$
+Level Code Message
+Error 1012 Raising an error
+Error 5555 RESIGNAL to error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01111" SET
+MESSAGE_TEXT = "RESIGNAL to a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Warning 1264 Out of range value for column 'a' at row 1
+Warning 5555 RESIGNAL to a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02444" SET
+MESSAGE_TEXT = "RESIGNAL to a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02444: RESIGNAL to a not found
+show warnings $$
+Level Code Message
+Warning 1264 Out of range value for column 'a' at row 1
+Error 5555 RESIGNAL to a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlwarning
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "44444" SET
+MESSAGE_TEXT = "RESIGNAL to an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+insert into t_warn set a= 9999999999999999;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 44444: RESIGNAL to an error
+show warnings $$
+Level Code Message
+Warning 1264 Out of range value for column 'a' at row 1
+Error 5555 RESIGNAL to an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01111" SET
+MESSAGE_TEXT = "RESIGNAL to a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1329 No data - zero rows fetched, selected, or processed
+Warning 5555 RESIGNAL to a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02444" SET
+MESSAGE_TEXT = "RESIGNAL to a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02444: RESIGNAL to a not found
+show warnings $$
+Level Code Message
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 5555 RESIGNAL to a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE x integer;
+DECLARE c cursor for select * from t_cursor;
+DECLARE CONTINUE HANDLER for not found
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "44444" SET
+MESSAGE_TEXT = "RESIGNAL to an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+open c;
+fetch c into x;
+close c;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 44444: RESIGNAL to an error
+show warnings $$
+Level Code Message
+Error 1329 No data - zero rows fetched, selected, or processed
+Error 5555 RESIGNAL to an error
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "01111" SET
+MESSAGE_TEXT = "RESIGNAL to a warning",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+after RESIGNAL
+after RESIGNAL
+Warnings:
+Error 1051 Unknown table 'no_such_table'
+Warning 5555 RESIGNAL to a warning
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "02444" SET
+MESSAGE_TEXT = "RESIGNAL to a not found",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 02444: RESIGNAL to a not found
+show warnings $$
+Level Code Message
+Error 1051 Unknown table 'no_such_table'
+Error 5555 RESIGNAL to a not found
+drop procedure test_resignal $$
+create procedure test_resignal()
+begin
+DECLARE CONTINUE HANDLER for sqlexception
+begin
+select "before RESIGNAL";
+RESIGNAL SQLSTATE "44444" SET
+MESSAGE_TEXT = "RESIGNAL to an error",
+MYSQL_ERRNO = 5555 ;
+select "after RESIGNAL";
+end;
+drop table no_such_table;
+end $$
+call test_resignal() $$
+before RESIGNAL
+before RESIGNAL
+ERROR 44444: RESIGNAL to an error
+show warnings $$
+Level Code Message
+Error 1051 Unknown table 'no_such_table'
+Error 5555 RESIGNAL to an error
+drop procedure test_resignal $$
+#
+# More complex cases
+#
+drop procedure if exists peter_p1 $$
+drop procedure if exists peter_p2 $$
+CREATE PROCEDURE peter_p1 ()
+BEGIN
+DECLARE x CONDITION FOR 1231;
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '2';
+RESIGNAL SET MYSQL_ERRNO = 9999;
+END;
+BEGIN
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '1';
+RESIGNAL SET SCHEMA_NAME = 'test';
+END;
+SET @@sql_mode=NULL;
+END;
+END
+$$
+CREATE PROCEDURE peter_p2 ()
+BEGIN
+DECLARE x CONDITION for 9999;
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '3';
+RESIGNAL SET MESSAGE_TEXT = 'Hi, I am a useless error message';
+END;
+CALL peter_p1();
+END
+$$
+CALL peter_p2() $$
+1
+1
+2
+2
+3
+3
+ERROR 42000: Hi, I am a useless error message
+show warnings $$
+Level Code Message
+Error 9999 Hi, I am a useless error message
+drop procedure peter_p1 $$
+drop procedure peter_p2 $$
+CREATE PROCEDURE peter_p1 ()
+BEGIN
+DECLARE x CONDITION FOR SQLSTATE '42000';
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '2';
+RESIGNAL x SET MYSQL_ERRNO = 9999;
+END;
+BEGIN
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '1';
+RESIGNAL x SET
+SCHEMA_NAME = 'test',
+MYSQL_ERRNO= 1231;
+END;
+/* Raises ER_WRONG_VALUE_FOR_VAR : 1231, SQLSTATE 42000 */
+SET @@sql_mode=NULL;
+END;
+END
+$$
+CREATE PROCEDURE peter_p2 ()
+BEGIN
+DECLARE x CONDITION for SQLSTATE '42000';
+DECLARE EXIT HANDLER FOR x
+BEGIN
+SELECT '3';
+RESIGNAL x SET
+MESSAGE_TEXT = 'Hi, I am a useless error message',
+MYSQL_ERRNO = 9999;
+END;
+CALL peter_p1();
+END
+$$
+CALL peter_p2() $$
+1
+1
+2
+2
+3
+3
+ERROR 42000: Hi, I am a useless error message
+show warnings $$
+Level Code Message
+Error 1231 Variable 'sql_mode' can't be set to the value of 'NULL'
+Error 1231 Variable 'sql_mode' can't be set to the value of 'NULL'
+Error 9999 Variable 'sql_mode' can't be set to the value of 'NULL'
+Error 9999 Hi, I am a useless error message
+drop procedure peter_p1 $$
+drop procedure peter_p2 $$
+drop procedure if exists peter_p3 $$
+Warnings:
+Note 1305 PROCEDURE peter_p3 does not exist
+create procedure peter_p3()
+begin
+declare continue handler for sqlexception
+resignal sqlstate '99002' set mysql_errno = 2;
+signal sqlstate '99001' set mysql_errno = 1, message_text = "Original";
+end $$
+call peter_p3() $$
+ERROR 99002: Original
+show warnings $$
+Level Code Message
+Error 1 Original
+Error 2 Original
+drop procedure peter_p3 $$
+drop table t_warn;
+drop table t_cursor;
+#
+# Miscelaneous test cases
+#
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 0x12; /* 18 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 0b00010010; /* 18 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = '65'; /* 65 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 'A'; /* illegal */
+end $$
+call test_signal $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'A'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = "65"; /* 65 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = "A"; /* illegal */
+end $$
+call test_signal $$
+ERROR 42000: Variable 'MYSQL_ERRNO' can't be set to the value of 'A'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = `65`; /* illegal */
+end $$
+call test_signal $$
+ERROR 42S22: Unknown column '65' in 'field list'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = `A`; /* illegal */
+end $$
+call test_signal $$
+ERROR 42S22: Unknown column 'A' in 'field list'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 3.141592; /* 3 */
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT= 0x41; /* A */
+end $$
+call test_signal $$
+ERROR 12345: A
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT= 0b01000001; /* A */
+end $$
+call test_signal $$
+ERROR 12345: A
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = "Hello";
+end $$
+call test_signal $$
+ERROR 12345: Hello
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = 'Hello';
+end $$
+call test_signal $$
+ERROR 12345: Hello
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = `Hello`;
+end $$
+call test_signal $$
+ERROR 42S22: Unknown column 'Hello' in 'field list'
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo SET MYSQL_ERRNO = 1000,
+MESSAGE_TEXT = 65.4321;
+end $$
+call test_signal $$
+ERROR 12345: 65.4321
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+DECLARE céÚçà foo CONDITION FOR SQLSTATE '12345';
+SIGNAL céÚçà SET MYSQL_ERRNO = 1000;
+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 '©ÃšÃ§Ã  foo CONDITION FOR SQLSTATE '12345';
+SIGNAL céÚçà SET ' at line 3
+create procedure test_signal()
+begin
+DECLARE "céÚçà" CONDITION FOR SQLSTATE '12345';
+SIGNAL "céÚçà" SET MYSQL_ERRNO = 1000;
+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 '"céÚçà" CONDITION FOR SQLSTATE '12345';
+SIGNAL "céÚçà" S' at line 3
+create procedure test_signal()
+begin
+DECLARE 'céÚçà' CONDITION FOR SQLSTATE '12345';
+SIGNAL 'céÚçà' SET MYSQL_ERRNO = 1000;
+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 ''céÚçà' CONDITION FOR SQLSTATE '12345';
+SIGNAL 'céÚçà' S' at line 3
+create procedure test_signal()
+begin
+DECLARE `céÚçà` CONDITION FOR SQLSTATE '12345';
+SIGNAL `céÚçà` SET MYSQL_ERRNO = 1000;
+end $$
+call test_signal $$
+ERROR 12345: Unhandled user-defined exception condition
+drop procedure test_signal $$
+create procedure test_signal()
+begin
+SIGNAL SQLSTATE '77777' SET MYSQL_ERRNO = 1000, MESSAGE_TEXT='ÁÂÃÅÄ';
+end $$
+drop procedure test_signal $$
diff --git a/mysql-test/r/signal_code.result b/mysql-test/r/signal_code.result
new file mode 100644
index 00000000000..8cda8877216
--- /dev/null
+++ b/mysql-test/r/signal_code.result
@@ -0,0 +1,35 @@
+use test;
+drop procedure if exists signal_proc;
+drop function if exists signal_func;
+create procedure signal_proc()
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo;
+SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+RESIGNAL foo;
+RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+end $$
+create function signal_func() returns int
+begin
+DECLARE foo CONDITION FOR SQLSTATE '12345';
+SIGNAL foo;
+SIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+RESIGNAL foo;
+RESIGNAL foo SET MESSAGE_TEXT = "This is an error message";
+return 0;
+end $$
+show procedure code signal_proc;
+Pos Instruction
+0 stmt 135 "SIGNAL foo"
+1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 136 "RESIGNAL foo"
+3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+drop procedure signal_proc;
+show function code signal_func;
+Pos Instruction
+0 stmt 135 "SIGNAL foo"
+1 stmt 135 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 136 "RESIGNAL foo"
+3 stmt 136 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+4 freturn 3 0
+drop function signal_func;
diff --git a/mysql-test/r/signal_demo1.result b/mysql-test/r/signal_demo1.result
new file mode 100644
index 00000000000..752f23a48d6
--- /dev/null
+++ b/mysql-test/r/signal_demo1.result
@@ -0,0 +1,270 @@
+drop database if exists demo;
+create database demo;
+use demo;
+create table ab_physical_person (
+person_id integer,
+first_name VARCHAR(50),
+middle_initial CHAR,
+last_name VARCHAR(50),
+primary key (person_id));
+create table ab_moral_person (
+company_id integer,
+name VARCHAR(100),
+primary key (company_id));
+create table in_inventory (
+item_id integer,
+descr VARCHAR(50),
+stock integer,
+primary key (item_id));
+create table po_order (
+po_id integer auto_increment,
+cust_type char, /* arc relationship, see cust_id */
+cust_id integer, /* FK to ab_physical_person *OR* ab_moral_person */
+primary key (po_id));
+create table po_order_line (
+po_id integer, /* FK to po_order.po_id */
+line_no integer,
+item_id integer, /* FK to in_inventory.item_id */
+qty integer);
+#
+# Schema integrity enforcement
+#
+create procedure check_pk_person(in person_type char, in id integer)
+begin
+declare x integer;
+declare msg varchar(128);
+/*
+Test integrity constraints for an 'arc' relationship.
+Based on 'person_type', 'id' points to either a
+physical person, or a moral person.
+*/
+case person_type
+when 'P' then
+begin
+select count(person_id) from ab_physical_person
+where ab_physical_person.person_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('No such physical person, PK:', id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end;
+when 'M' then
+begin
+select count(company_id) from ab_moral_person
+where ab_moral_person.company_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('No such moral person, PK:', id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end;
+else
+begin
+set msg= concat('No such person type:', person_type);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 20000;
+end;
+end case;
+end
+$$
+create procedure check_pk_inventory(in id integer)
+begin
+declare x integer;
+declare msg varchar(128);
+select count(item_id) from in_inventory
+where in_inventory.item_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('Failed integrity constraint, table in_inventory, PK:',
+id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end
+$$
+create procedure check_pk_order(in id integer)
+begin
+declare x integer;
+declare msg varchar(128);
+select count(po_id) from po_order
+where po_order.po_id = id
+into x;
+if (x != 1)
+then
+set msg= concat('Failed integrity constraint, table po_order, PK:', id);
+SIGNAL SQLSTATE '45000' SET
+MESSAGE_TEXT = msg,
+MYSQL_ERRNO = 10000;
+end if;
+end
+$$
+create trigger po_order_bi before insert on po_order
+for each row
+begin
+call check_pk_person(NEW.cust_type, NEW.cust_id);
+end
+$$
+create trigger po_order_bu before update on po_order
+for each row
+begin
+call check_pk_person(NEW.cust_type, NEW.cust_id);
+end
+$$
+create trigger po_order_line_bi before insert on po_order_line
+for each row
+begin
+call check_pk_order(NEW.po_id);
+call check_pk_inventory(NEW.item_id);
+end
+$$
+create trigger po_order_line_bu before update on po_order_line
+for each row
+begin
+call check_pk_order(NEW.po_id);
+call check_pk_inventory(NEW.item_id);
+end
+$$
+#
+# Application helpers
+#
+create procedure po_create_order(
+in p_cust_type char,
+in p_cust_id integer,
+out id integer)
+begin
+insert into po_order set cust_type = p_cust_type, cust_id = p_cust_id;
+set id = last_insert_id();
+end
+$$
+create procedure po_add_order_line(
+in po integer,
+in line integer,
+in item integer,
+in q integer)
+begin
+insert into po_order_line set
+po_id = po, line_no = line, item_id = item, qty = q;
+end
+$$
+#
+# Create sample data
+#
+insert into ab_physical_person values
+( 1, "John", "A", "Doe"),
+( 2, "Marry", "B", "Smith")
+;
+insert into ab_moral_person values
+( 3, "ACME real estate, INC"),
+( 4, "Local school")
+;
+insert into in_inventory values
+( 100, "Table, dinner", 5),
+( 101, "Chair", 20),
+( 200, "Table, coffee", 3),
+( 300, "School table", 25),
+( 301, "School chairs", 50)
+;
+select * from ab_physical_person order by person_id;
+person_id first_name middle_initial last_name
+1 John A Doe
+2 Marry B Smith
+select * from ab_moral_person order by company_id;
+company_id name
+3 ACME real estate, INC
+4 Local school
+select * from in_inventory order by item_id;
+item_id descr stock
+100 Table, dinner 5
+101 Chair 20
+200 Table, coffee 3
+300 School table 25
+301 School chairs 50
+#
+# Entering an order
+#
+set @my_po = 0;
+/* John Doe wants 1 table and 4 chairs */
+call po_create_order("P", 1, @my_po);
+call po_add_order_line (@my_po, 1, 100, 1);
+call po_add_order_line (@my_po, 2, 101, 4);
+/* Marry Smith wants a coffee table */
+call po_create_order("P", 2, @my_po);
+call po_add_order_line (@my_po, 1, 200, 1);
+#
+# Entering bad data in an order
+#
+call po_add_order_line (@my_po, 1, 999, 1);
+ERROR 45000: Failed integrity constraint, table in_inventory, PK:999
+#
+# Entering bad data in an unknown order
+#
+call po_add_order_line (99, 1, 100, 1);
+ERROR 45000: Failed integrity constraint, table po_order, PK:99
+#
+# Entering an order for an unknown company
+#
+call po_create_order("M", 7, @my_po);
+ERROR 45000: No such moral person, PK:7
+#
+# Entering an order for an unknown person type
+#
+call po_create_order("X", 1, @my_po);
+ERROR 45000: No such person type:X
+/* The local school wants 10 class tables and 20 chairs */
+call po_create_order("M", 4, @my_po);
+call po_add_order_line (@my_po, 1, 300, 10);
+call po_add_order_line (@my_po, 2, 301, 20);
+select * from po_order;
+po_id cust_type cust_id
+1 P 1
+2 P 2
+3 M 4
+select * from po_order_line;
+po_id line_no item_id qty
+1 1 100 1
+1 2 101 4
+2 1 200 1
+3 1 300 10
+3 2 301 20
+select po_id as "PO#",
+( case cust_type
+when "P" then concat (pp.first_name,
+" ",
+pp.middle_initial,
+" ",
+pp.last_name)
+when "M" then mp.name
+end ) as "Sold to"
+ from po_order po
+left join ab_physical_person pp on po.cust_id = pp.person_id
+left join ab_moral_person mp on po.cust_id = company_id
+;
+PO# Sold to
+1 John A Doe
+2 Marry B Smith
+3 Local school
+select po_id as "PO#",
+ol.line_no as "Line",
+ol.item_id as "Item",
+inv.descr as "Description",
+ol.qty as "Quantity"
+ from po_order_line ol, in_inventory inv
+where inv.item_id = ol.item_id
+order by ol.item_id, ol.line_no;
+PO# Line Item Description Quantity
+1 1 100 Table, dinner 1
+1 2 101 Chair 4
+2 1 200 Table, coffee 1
+3 1 300 School table 10
+3 2 301 School chairs 20
+drop database demo;
diff --git a/mysql-test/r/signal_demo2.result b/mysql-test/r/signal_demo2.result
new file mode 100644
index 00000000000..223030b0624
--- /dev/null
+++ b/mysql-test/r/signal_demo2.result
@@ -0,0 +1,197 @@
+drop database if exists demo;
+create database demo;
+use demo;
+create procedure proc_top_a(p1 integer)
+begin
+## DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
+begin
+end;
+select "Starting ...";
+call proc_middle_a(p1);
+select "The end";
+end
+$$
+create procedure proc_middle_a(p1 integer)
+begin
+DECLARE l integer;
+# without RESIGNAL:
+# Should be: DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
+DECLARE EXIT HANDLER for 1 /* not sure how to handle exceptions */
+begin
+select "Oops ... now what ?";
+end;
+select "In prod_middle()";
+create temporary table t1(a integer, b integer);
+select GET_LOCK("user_mutex", 10) into l;
+insert into t1 set a = p1, b = p1;
+call proc_bottom_a(p1);
+select RELEASE_LOCK("user_mutex") into l;
+drop temporary table t1;
+end
+$$
+create procedure proc_bottom_a(p1 integer)
+begin
+select "In proc_bottom()";
+if (p1 = 1) then
+begin
+select "Doing something that works ...";
+select * from t1;
+end;
+end if;
+if (p1 = 2) then
+begin
+select "Doing something that fail (simulate an error) ...";
+drop table no_such_table;
+end;
+end if;
+if (p1 = 3) then
+begin
+select "Doing something that *SHOULD* works ...";
+select * from t1;
+end;
+end if;
+end
+$$
+call proc_top_a(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that works ...
+Doing something that works ...
+a b
+1 1
+The end
+The end
+call proc_top_a(2);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that fail (simulate an error) ...
+Doing something that fail (simulate an error) ...
+ERROR 42S02: Unknown table 'no_such_table'
+call proc_top_a(3);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+ERROR 42S01: Table 't1' already exists
+call proc_top_a(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+ERROR 42S01: Table 't1' already exists
+drop temporary table if exists t1;
+create procedure proc_top_b(p1 integer)
+begin
+select "Starting ...";
+call proc_middle_b(p1);
+select "The end";
+end
+$$
+create procedure proc_middle_b(p1 integer)
+begin
+DECLARE l integer;
+DECLARE EXIT HANDLER for SQLEXCEPTION, NOT FOUND
+begin
+begin
+DECLARE CONTINUE HANDLER for SQLEXCEPTION, NOT FOUND
+begin
+/* Ignore errors from the cleanup code */
+end;
+select "Doing cleanup !";
+select RELEASE_LOCK("user_mutex") into l;
+drop temporary table t1;
+end;
+RESIGNAL;
+end;
+select "In prod_middle()";
+create temporary table t1(a integer, b integer);
+select GET_LOCK("user_mutex", 10) into l;
+insert into t1 set a = p1, b = p1;
+call proc_bottom_b(p1);
+select RELEASE_LOCK("user_mutex") into l;
+drop temporary table t1;
+end
+$$
+create procedure proc_bottom_b(p1 integer)
+begin
+select "In proc_bottom()";
+if (p1 = 1) then
+begin
+select "Doing something that works ...";
+select * from t1;
+end;
+end if;
+if (p1 = 2) then
+begin
+select "Doing something that fail (simulate an error) ...";
+drop table no_such_table;
+end;
+end if;
+if (p1 = 3) then
+begin
+select "Doing something that *SHOULD* works ...";
+select * from t1;
+end;
+end if;
+end
+$$
+call proc_top_b(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that works ...
+Doing something that works ...
+a b
+1 1
+The end
+The end
+call proc_top_b(2);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that fail (simulate an error) ...
+Doing something that fail (simulate an error) ...
+Doing cleanup !
+Doing cleanup !
+ERROR 42S02: Unknown table 'no_such_table'
+call proc_top_b(3);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that *SHOULD* works ...
+Doing something that *SHOULD* works ...
+a b
+3 3
+The end
+The end
+call proc_top_b(1);
+Starting ...
+Starting ...
+In prod_middle()
+In prod_middle()
+In proc_bottom()
+In proc_bottom()
+Doing something that works ...
+Doing something that works ...
+a b
+1 1
+The end
+The end
+drop database demo;
diff --git a/mysql-test/r/signal_demo3.result b/mysql-test/r/signal_demo3.result
new file mode 100644
index 00000000000..aa769659e51
--- /dev/null
+++ b/mysql-test/r/signal_demo3.result
@@ -0,0 +1,143 @@
+SET @start_global_value = @@global.max_error_count;
+SELECT @start_global_value;
+@start_global_value
+64
+SET @start_session_value = @@session.max_error_count;
+SELECT @start_session_value;
+@start_session_value
+64
+drop database if exists demo;
+create database demo;
+use demo;
+create procedure proc_1()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_1';
+call proc_2();
+end
+$$
+create procedure proc_2()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_2';
+call proc_3();
+end
+$$
+create procedure proc_3()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_3';
+call proc_4();
+end
+$$
+create procedure proc_4()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_4';
+call proc_5();
+end
+$$
+create procedure proc_5()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_5';
+call proc_6();
+end
+$$
+create procedure proc_6()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_6';
+call proc_7();
+end
+$$
+create procedure proc_7()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_7';
+call proc_8();
+end
+$$
+create procedure proc_8()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_8';
+call proc_9();
+end
+$$
+create procedure proc_9()
+begin
+declare exit handler for sqlexception
+resignal sqlstate '45000' set message_text='Oops in proc_9';
+## Do something that fails, to see how errors are reported
+drop table oops_it_is_not_here;
+end
+$$
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1051 Unknown table 'oops_it_is_not_here'
+Error 1644 Oops in proc_9
+Error 1644 Oops in proc_8
+Error 1644 Oops in proc_7
+Error 1644 Oops in proc_6
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+SET @@session.max_error_count = 5;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+5
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+SET @@session.max_error_count = 7;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+7
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1644 Oops in proc_7
+Error 1644 Oops in proc_6
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+SET @@session.max_error_count = 9;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+9
+call proc_1();
+ERROR 45000: Oops in proc_1
+show warnings;
+Level Code Message
+Error 1644 Oops in proc_9
+Error 1644 Oops in proc_8
+Error 1644 Oops in proc_7
+Error 1644 Oops in proc_6
+Error 1644 Oops in proc_5
+Error 1644 Oops in proc_4
+Error 1644 Oops in proc_3
+Error 1644 Oops in proc_2
+Error 1644 Oops in proc_1
+drop database demo;
+SET @@global.max_error_count = @start_global_value;
+SELECT @@global.max_error_count;
+@@global.max_error_count
+64
+SET @@session.max_error_count = @start_session_value;
+SELECT @@session.max_error_count;
+@@session.max_error_count
+64
diff --git a/mysql-test/r/signal_sqlmode.result b/mysql-test/r/signal_sqlmode.result
new file mode 100644
index 00000000000..8fed85eb4a9
--- /dev/null
+++ b/mysql-test/r/signal_sqlmode.result
@@ -0,0 +1,86 @@
+SET @save_sql_mode=@@sql_mode;
+SET sql_mode='';
+drop procedure if exists p;
+drop procedure if exists p2;
+drop procedure if exists p3;
+create procedure p()
+begin
+declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
+set utf8_var = concat(repeat('A', 128), 'X');
+select length(utf8_var), utf8_var;
+end
+$$
+create procedure p2()
+begin
+declare msg VARCHAR(129) CHARACTER SET UTF8;
+set msg = concat(repeat('A', 128), 'X');
+select length(msg), msg;
+signal sqlstate '55555' set message_text = msg;
+end
+$$
+create procedure p3()
+begin
+declare name VARCHAR(65) CHARACTER SET UTF8;
+set name = concat(repeat('A', 64), 'X');
+select length(name), name;
+signal sqlstate '55555' set
+message_text = 'Message',
+table_name = name;
+end
+$$
+call p;
+length(utf8_var) utf8_var
+128 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+Warnings:
+Warning 1265 Data truncated for column 'utf8_var' at row 1
+call p2;
+length(msg) msg
+129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR 55555: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+call p3;
+length(name) name
+65 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR 55555: Message
+drop procedure p;
+drop procedure p2;
+drop procedure p3;
+SET sql_mode='STRICT_ALL_TABLES';
+create procedure p()
+begin
+declare utf8_var VARCHAR(128) CHARACTER SET UTF8;
+set utf8_var = concat(repeat('A', 128), 'X');
+select length(utf8_var), utf8_var;
+end
+$$
+create procedure p2()
+begin
+declare msg VARCHAR(129) CHARACTER SET UTF8;
+set msg = concat(repeat('A', 128), 'X');
+select length(msg), msg;
+signal sqlstate '55555' set message_text = msg;
+end
+$$
+create procedure p3()
+begin
+declare name VARCHAR(65) CHARACTER SET UTF8;
+set name = concat(repeat('A', 64), 'X');
+select length(name), name;
+signal sqlstate '55555' set
+message_text = 'Message',
+table_name = name;
+end
+$$
+call p;
+ERROR 22001: Data too long for column 'utf8_var' at row 1
+call p2;
+length(msg) msg
+129 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR HY000: Data too long for condition item 'MESSAGE_TEXT'
+call p3;
+length(name) name
+65 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
+ERROR HY000: Data too long for condition item 'TABLE_NAME'
+drop procedure p;
+drop procedure p2;
+drop procedure p3;
+SET @@sql_mode=@save_sql_mode;
diff --git a/mysql-test/r/sp-code.result b/mysql-test/r/sp-code.result
index 39770dc4f2a..949976719ea 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 94 "call sudoku_init()"
+3 stmt 93 "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 94 "call sudoku_count()"
+7 stmt 93 "call sudoku_count()"
8 stmt 6 "insert into sudoku_schedule (row,col)..."
9 set v_scounter@2 0
10 set v_i@3 1
diff --git a/mysql-test/r/sp-dynamic.result b/mysql-test/r/sp-dynamic.result
index 34b76a9424f..cdfeb8ab020 100644
--- a/mysql-test/r/sp-dynamic.result
+++ b/mysql-test/r/sp-dynamic.result
@@ -97,8 +97,6 @@ end|
call p1()|
a
1
-Warnings:
-Note 1051 Unknown table 't1'
call p1()|
a
1
@@ -371,9 +369,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
select @a|
@a
0
@@ -382,9 +377,6 @@ call p1(@a)|
create table t1 (a int)
@rsql
create table t2 (a int)
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
select @a|
@a
0
diff --git a/mysql-test/r/sp-no-code.result b/mysql-test/r/sp-no-code.result
new file mode 100644
index 00000000000..77d2c93eaf6
--- /dev/null
+++ b/mysql-test/r/sp-no-code.result
@@ -0,0 +1,4 @@
+show procedure code foo;
+ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
+show function code foo;
+ERROR HY000: The 'SHOW PROCEDURE|FUNCTION CODE' feature is disabled; you need MySQL built with '--with-debug' to have it working
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index c45ada2047a..4ea26d1021a 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -349,9 +349,9 @@ CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
---> connection: mysqltest_1_con
USE mysqltest;
CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
---> connection: mysqltest_2_con
use mysqltest;
diff --git a/mysql-test/r/sp-vars.result b/mysql-test/r/sp-vars.result
index f5420a62f63..f167986e82c 100644
--- a/mysql-test/r/sp-vars.result
+++ b/mysql-test/r/sp-vars.result
@@ -110,24 +110,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Warning 1264 Out of range value for column 'v1' at row 1
-Warning 1264 Out of range value for column 'v1u' at row 1
-Warning 1264 Out of range value for column 'v2' at row 1
-Warning 1264 Out of range value for column 'v2u' at row 1
-Warning 1264 Out of range value for column 'v3' at row 1
-Warning 1264 Out of range value for column 'v3u' at row 1
-Warning 1264 Out of range value for column 'v4' at row 1
-Warning 1264 Out of range value for column 'v4u' at row 1
-Warning 1264 Out of range value for column 'v5' at row 1
-Warning 1264 Out of range value for column 'v5u' at row 1
-Warning 1264 Out of range value for column 'v6' at row 1
-Warning 1264 Out of range value for column 'v6u' at row 1
-Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
-Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
-Warning 1265 Data truncated for column 'v12' at row 1
-Warning 1265 Data truncated for column 'v13' at row 1
-Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
-Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@@ -143,21 +125,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Warning 1264 Out of range value for column 'u3' at row 1
-Warning 1264 Out of range value for column 'u4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@@ -198,24 +165,6 @@ v7 v8 v9 v10 v11 v12 v13 v14 v15 v16
v17 v18 v19 v20
12.00 12.12 12.00 12.12
Warnings:
-Warning 1264 Out of range value for column 'v1' at row 1
-Warning 1264 Out of range value for column 'v1u' at row 1
-Warning 1264 Out of range value for column 'v2' at row 1
-Warning 1264 Out of range value for column 'v2u' at row 1
-Warning 1264 Out of range value for column 'v3' at row 1
-Warning 1264 Out of range value for column 'v3u' at row 1
-Warning 1264 Out of range value for column 'v4' at row 1
-Warning 1264 Out of range value for column 'v4u' at row 1
-Warning 1264 Out of range value for column 'v5' at row 1
-Warning 1264 Out of range value for column 'v5u' at row 1
-Warning 1264 Out of range value for column 'v6' at row 1
-Warning 1264 Out of range value for column 'v6u' at row 1
-Warning 1366 Incorrect integer value: 'String 10 ' for column 'v10' at row 1
-Warning 1366 Incorrect integer value: 'String10' for column 'v11' at row 1
-Warning 1265 Data truncated for column 'v12' at row 1
-Warning 1265 Data truncated for column 'v13' at row 1
-Warning 1366 Incorrect integer value: 'Hello, world' for column 'v16' at row 1
-Note 1265 Data truncated for column 'v18' at row 1
Note 1265 Data truncated for column 'v20' at row 1
CALL sp_vars_check_assignment();
i1 i2 i3 i4
@@ -231,21 +180,6 @@ d1 d2 d3
d1 d2 d3
1234.00 1234.12 1234.12
Warnings:
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'i1' at row 1
-Warning 1264 Out of range value for column 'i2' at row 1
-Warning 1264 Out of range value for column 'i3' at row 1
-Warning 1264 Out of range value for column 'i4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Warning 1264 Out of range value for column 'u3' at row 1
-Warning 1264 Out of range value for column 'u4' at row 1
-Warning 1264 Out of range value for column 'u1' at row 1
-Warning 1264 Out of range value for column 'u2' at row 1
-Note 1265 Data truncated for column 'd3' at row 1
Note 1265 Data truncated for column 'd3' at row 1
SELECT sp_vars_check_ret1();
sp_vars_check_ret1()
@@ -451,10 +385,6 @@ FF
HEX(v10)
FF
Warnings:
-Warning 1264 Out of range value for column 'v8' at row 1
-Warning 1264 Out of range value for column 'v9' at row 1
-Warning 1264 Out of range value for column 'v10' at row 1
-Warning 1264 Out of range value for column 'v1' at row 1
Warning 1264 Out of range value for column 'v5' at row 1
DROP PROCEDURE p1;
@@ -1228,3 +1158,30 @@ f1() @b
0 abc
drop function f1;
drop table t1;
+
+---------------------------------------------------------------
+BUG#28299
+---------------------------------------------------------------
+
+CREATE PROCEDURE ctest()
+BEGIN
+DECLARE i CHAR(16);
+DECLARE j INT;
+SET i= 'string';
+SET j= 1 + i;
+END|
+CALL ctest();
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'string '
+DROP PROCEDURE ctest;
+CREATE PROCEDURE vctest()
+BEGIN
+DECLARE i VARCHAR(16);
+DECLARE j INT;
+SET i= 'string';
+SET j= 1 + i;
+END|
+CALL vctest();
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 'string'
+DROP PROCEDURE vctest;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 83ad7545685..91a4ceae55c 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -526,8 +526,6 @@ end|
delete from t1|
create table t3 ( s char(16), d int)|
call into_test4()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
select * from t3|
s d
into4 NULL
@@ -1120,8 +1118,6 @@ end|
select f9()|
f9()
6
-Warnings:
-Note 1051 Unknown table 't3'
select f9() from t1 limit 1|
f9()
6
@@ -1162,8 +1158,6 @@ drop temporary table t3|
select f12_1()|
f12_1()
3
-Warnings:
-Note 1051 Unknown table 't3'
select f12_1() from t1 limit 1|
f12_1()
3
@@ -2069,12 +2063,7 @@ end if;
insert into t4 values (2, rc, t3);
end|
call bug1863(10)|
-Warnings:
-Note 1051 Unknown table 'temp_t1'
-Warning 1329 No data - zero rows fetched, selected, or processed
call bug1863(10)|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
select * from t4|
f1 rc t3
2 0 NULL
@@ -2339,11 +2328,7 @@ begin
end|
call bug4579_1()|
call bug4579_1()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
call bug4579_1()|
-Warnings:
-Warning 1329 No data - zero rows fetched, selected, or processed
drop procedure bug4579_1|
drop procedure bug4579_2|
drop table t3|
@@ -2392,7 +2377,6 @@ create procedure bug4902()
begin
show charset like 'foo';
show collation like 'foo';
-show column types;
show create table t1;
show create database test;
show databases like 'foo';
@@ -2410,9 +2394,6 @@ end|
call bug4902()|
Charset Description Default collation Maxlen
Collation Charset Id Default Compiled Sortlen
-Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
-tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
-tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
Table Create Table
t1 CREATE TABLE `t1` (
`id` char(16) NOT NULL DEFAULT '',
@@ -2434,9 +2415,6 @@ Level Code Message
call bug4902()|
Charset Description Default collation Maxlen
Collation Charset Id Default Compiled Sortlen
-Type Size Min_Value Max_Value Prec Scale Nullable Auto_Increment Unsigned Zerofill Searchable Case_Sensitive Default Comment
-tinyint 1 -128 127 0 0 YES YES NO YES YES NO NULL,0 A very small integer
-tinyint unsigned 1 0 255 0 0 YES YES YES YES YES NO NULL,0 A very small integer
Table Create Table
t1 CREATE TABLE `t1` (
`id` char(16) NOT NULL DEFAULT '',
@@ -3736,9 +3714,6 @@ Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
`spv1` decimal(3,3) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-Warnings:
-Warning 1264 Out of range value for column 'spv1' at row 1
-Warning 1366 Incorrect decimal value: 'test' for column 'spv1' at row 1
call bug12589_2()|
Table Create Table
tm1 CREATE TEMPORARY TABLE `tm1` (
@@ -6106,35 +6081,6 @@ bug5274_f2()
x
Warnings:
Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
-Warning 1265 Data truncated for column 'bug5274_f1' at row 1
DROP FUNCTION bug5274_f1|
DROP FUNCTION bug5274_f2|
drop procedure if exists proc_21513|
@@ -6229,20 +6175,17 @@ f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
PREPARE s1 FROM 'SELECT f1(2)';
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
EXECUTE s1;
f1(2)
0
Warnings:
Warning 1329 No data - zero rows fetched, selected, or processed
-Warning 1329 No data - zero rows fetched, selected, or processed
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP FUNCTION f1;
@@ -6254,6 +6197,7 @@ create procedure mysqltest_db1.sp_bug28551() begin end;
call mysqltest_db1.sp_bug28551();
show warnings;
Level Code Message
+Note 1008 Can't drop database 'mysqltest_db1'; database doesn't exist
drop database mysqltest_db1;
drop database if exists mysqltest_db1;
drop table if exists test.t1;
@@ -7040,3 +6984,35 @@ DROP PROCEDURE p5;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
+DROP FUNCTION IF EXISTS f1;
+DROP TABLE IF EXISTS t_non_existing;
+DROP TABLE IF EXISTS t1;
+CREATE FUNCTION f1() RETURNS INT
+BEGIN
+DECLARE v INT;
+SELECT a INTO v FROM t_non_existing;
+RETURN 1;
+END|
+CREATE TABLE t1 (a INT) ENGINE = myisam;
+INSERT INTO t1 VALUES (1);
+SELECT * FROM t1 WHERE a = f1();
+ERROR 42S02: Table 'test.t_non_existing' doesn't exist
+DROP FUNCTION f1;
+DROP TABLE t1;
+#
+# Bug#34197: CREATE PROCEDURE fails when COMMENT truncated in non
+# strict SQL mode
+#
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1 ()
+COMMENT
+'12345678901234567890123456789012345678901234567890123456789012345678901234567890'
+BEGIN
+END;
+SELECT comment FROM mysql.proc WHERE name = "p1";
+comment
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
+SELECT routine_comment FROM information_schema.routines WHERE routine_name = "p1";
+routine_comment
+12345678901234567890123456789012345678901234567890123456789012345678901234567890
+DROP PROCEDURE p1;
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 831616f491b..228fe008447 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -21,9 +21,11 @@ end|
call bug4902_2()|
show warnings|
Level Code Message
+Note 1305 PROCEDURE bug4902_2 does not exist
call bug4902_2()|
show warnings|
Level Code Message
+Note 1305 PROCEDURE bug4902_2 does not exist
drop procedure bug4902_2|
drop table if exists t1|
create table t1 (
diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result
index 3cc251bc0a6..be45e5ff5d7 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -556,3 +556,30 @@ f1 bug13575(f1)
3 ccc
drop function bug13575|
drop table t3|
+#
+# End of 5.1 tests
+#
+#
+# Bug #35877 Update .. WHERE with function, constraint violation, crash
+#
+DROP TABLE IF EXISTS t1_aux|
+DROP TABLE IF EXISTS t1_not_null|
+DROP FUNCTION IF EXISTS f1_two_inserts|
+# MyISAM test
+CREATE TABLE t1_not_null (f1 BIGINT, f2 BIGINT NOT NULL)|
+CREATE TABLE t1_aux (f1 BIGINT, f2 BIGINT)|
+INSERT INTO t1_aux VALUES (1,1)|
+CREATE FUNCTION f1_two_inserts() returns INTEGER
+BEGIN
+INSERT INTO t1_not_null SET f1 = 10, f2 = NULL;
+RETURN 1;
+END|
+UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
+ERROR 23000: Column 'f2' cannot be null
+# InnoDB test
+ALTER TABLE t1_not_null ENGINE = InnoDB|
+ALTER TABLE t1_aux ENGINE = InnoDB|
+UPDATE t1_aux SET f2 = 2 WHERE f1 = f1_two_inserts()|
+ERROR 23000: Column 'f2' cannot be null
+DROP TABLE t1_aux, t1_not_null|
+DROP FUNCTION f1_two_inserts|
diff --git a/mysql-test/r/sp_trans_log.result b/mysql-test/r/sp_trans_log.result
index 7a6173b89e2..117f6de754a 100644
--- a/mysql-test/r/sp_trans_log.result
+++ b/mysql-test/r/sp_trans_log.result
@@ -14,15 +14,5 @@ end|
reset master|
insert into t2 values (bug23333(),1)|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
-show binlog events from 106 /* with fixes for #23333 will show there is the query */|
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 # Query 1 # #
-master-bin.000001 # Table_map 1 # #
-master-bin.000001 # Table_map 1 # #
-master-bin.000001 # Write_rows 1 # #
-master-bin.000001 # Query 1 # #
-select count(*),@a from t1 /* must be 1,1 */|
-count(*) @a
-1 1
drop table t1,t2;
drop function if exists bug23333;
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index 0b0d5a38d0b..e83879274a1 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -506,6 +506,12 @@ mysqltest_32753@localhost
set session sql_mode=@OLD_SQL_MODE;
flush privileges;
drop user mysqltest_32753@localhost;
+SET @org_mode=@@sql_mode;
+SET @@sql_mode='traditional';
+SELECT @@sql_mode LIKE '%NO_ENGINE_SUBSTITUTION%';
+@@sql_mode LIKE '%NO_ENGINE_SUBSTITUTION%'
+1
+SET sql_mode=@org_mode;
DROP TABLE IF EXISTS t1,t2;
CREATE USER 'user_PCTFL'@'localhost' identified by 'PWD';
CREATE USER 'user_no_PCTFL'@'localhost' identified by 'PWD';
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 241f4198bf7..897c9072203 100644
--- a/mysql-test/r/strict.result
+++ b/mysql-test/r/strict.result
@@ -2,7 +2,7 @@ set @org_mode=@@sql_mode;
set @@sql_mode='ansi,traditional';
select @@sql_mode;
@@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
+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,NO_ENGINE_SUBSTITUTION
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (col1 date);
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
@@ -315,8 +315,8 @@ MOD(col1,0)
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT INTO t1 (col1) VALUES(-129);
ERROR 22003: Out of range value for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES(128);
@@ -343,7 +343,7 @@ SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 1;
MOD(col1,0)
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
UPDATE t1 SET col1 = col1 - 50 WHERE col1 < 0;
ERROR 22003: Out of range value for column 'col1' at row 1
UPDATE t1 SET col2=col2 + 50 WHERE col2 > 0;
@@ -353,16 +353,16 @@ ERROR 22012: Division by 0
set @@sql_mode='ERROR_FOR_DIVISION_BY_ZERO';
INSERT INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
set @@sql_mode='ansi,traditional';
SELECT MOD(col1,0) FROM t1 WHERE col1 > 0 LIMIT 2;
MOD(col1,0)
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT INTO t1 (col1) VALUES ('');
ERROR HY000: Incorrect integer value: '' for column 'col1' at row 1
INSERT INTO t1 (col1) VALUES ('a59b');
@@ -374,8 +374,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
set @@sql_mode='ansi';
INSERT INTO t1 values (1/0,1/0);
set @@sql_mode='ansi,traditional';
@@ -457,8 +457,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-32769,-1),(32768,65536);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -541,8 +541,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-8388609,-1),(8388608,16777216);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -625,8 +625,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 values (-2147483649, -1),(2147643648,4294967296);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -707,8 +707,8 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0,1/0);
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(-9223372036854775809,-1),(9223372036854775808,18446744073709551616);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -794,7 +794,7 @@ Warnings:
Note 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 values (1/0);
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES(1000),(-1000);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -861,7 +861,7 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) VALUES (1/0);
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES (+3.4E+39,-3.4E+39);
Warnings:
Warning 1264 Out of range value for column 'col1' at row 1
@@ -910,7 +910,7 @@ Warnings:
Warning 1265 Data truncated for column 'col1' at row 1
INSERT IGNORE INTO t1 (col1) values (1/0);
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
INSERT IGNORE INTO t1 VALUES (+1.9E+309,-1.9E+309);
ERROR 22007: Illegal double '1.9E+309' value found during parsing
INSERT IGNORE INTO t1 VALUES ('+2.0E+309','-2.0E+309');
@@ -1080,13 +1080,13 @@ Warnings:
Warning 1292 Truncated incorrect datetime value: '31.10.2004 15.30 abc'
insert into t1 values(STR_TO_DATE('32.10.2004 15.30','%d.%m.%Y %H.%i'));
Warnings:
-Error 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
+Warning 1411 Incorrect datetime value: '32.10.2004 15.30' for function str_to_date
insert into t1 values(STR_TO_DATE('2004.12.12 22:22:33 AM','%Y.%m.%d %r'));
Warnings:
-Error 1411 Incorrect time value: '22:22:33 AM' for function str_to_date
+Warning 1411 Incorrect time value: '22:22:33 AM' for function str_to_date
insert into t1 values(STR_TO_DATE('2004.12.12 abc','%Y.%m.%d %T'));
Warnings:
-Error 1411 Incorrect time value: 'abc' for function str_to_date
+Warning 1411 Incorrect time value: 'abc' for function str_to_date
insert into t1 values(STR_TO_DATE('31.10.2004 15.30','%d.%m.%Y %H.%i'));
insert into t1 values(STR_TO_DATE('2004.12.12 11:22:33 AM','%Y.%m.%d %r'));
insert into t1 values(STR_TO_DATE('2004.12.12 10:22:59','%Y.%m.%d %T'));
@@ -1104,9 +1104,9 @@ select count(*) from t1 where STR_TO_DATE('2004.12.12 10:22:61','%Y.%m.%d %T') I
count(*)
7
Warnings:
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
-Error 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
+Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
+Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
+Warning 1411 Incorrect datetime value: '2004.12.12 10:22:61' for function str_to_date
drop table t1;
create table t1 (col1 char(3), col2 integer);
insert into t1 (col1) values (cast(1000 as char(3)));
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 665473df3ef..2056b06a80d 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -50,7 +50,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select 1 AS `1` from (select 1 AS `a`) `b` having ((select '1' AS `a`) = 1)
+Note 1003 select 1 AS `1` from dual having ((select '1' AS `a`) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
1
@@ -203,7 +203,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DERIVED t2 ALL NULL NULL NULL NULL 2 100.00 Using where
2 SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using filesort
Warnings:
-Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from (select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where (`test`.`t2`.`a` > 1)) `tt`
+Note 1003 select (select `test`.`t3`.`a` AS `a` from `test`.`t3` where (`test`.`t3`.`a` < 8) order by 1 desc limit 1) AS `(select t3.a from t3 where a<8 order by 1 desc limit 1)`,'2' AS `a` from dual
select * from t1 where t1.a=(select t2.a from t2 where t2.b=(select max(a) from t3) order by 1 desc limit 1);
a
2
@@ -314,7 +314,7 @@ NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
Note 1276 Field or reference 'test.t2.a' of SELECT #2 was resolved in SELECT #1
Note 1276 Field or reference 'test.t2.a' of SELECT #3 was resolved in SELECT #1
-Note 1003 select (select '2' AS `a` from `test`.`t1` where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
+Note 1003 select (select '2' AS `a` from dual where ('2' = `test`.`t2`.`a`) union select `test`.`t5`.`a` AS `a` from `test`.`t5` where (`test`.`t5`.`a` = `test`.`t2`.`a`)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,`test`.`t2`.`a` AS `a` from `test`.`t2`
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
@@ -1429,7 +1429,7 @@ explain extended (select * from t1);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 (select 'tttt' AS `s1` from `test`.`t1`)
+Note 1003 (select 'tttt' AS `s1` from dual)
(select * from t1);
s1
tttt
@@ -1617,7 +1617,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 UNION t1 system NULL NULL NULL NULL 1 100.00
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
Warnings:
-Note 1003 select 'e' AS `s1` from `test`.`t1` where 1
+Note 1003 select 'e' AS `s1` from dual where 1
drop table t1;
CREATE TABLE t1 (number char(11) NOT NULL default '') ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('69294728265'),('18621828126'),('89356874041'),('95895001874');
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index d5fb1a7bbde..3a0576768b2 100644
--- a/mysql-test/r/subselect3.result
+++ b/mysql-test/r/subselect3.result
@@ -864,7 +864,7 @@ Level Code Message
Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #2
Note 1276 Field or reference 'test.t1.c' of SELECT #3 was resolved in SELECT #2
Error 1054 Unknown column 'c' in 'field list'
-Note 1003 select `c` AS `c` from (select (select count(`test`.`t1`.`a`) AS `COUNT(a)` from (select count(`test`.`t1`.`b`) AS `COUNT(b)` from `test`.`t1`) `x` group by `c`) AS `(SELECT COUNT(a) FROM
+Note 1003 select `c` AS `c` from (select (select count(`test`.`t1`.`a`) AS `COUNT(a)` from dual group by `c`) AS `(SELECT COUNT(a) FROM
(SELECT COUNT(b) FROM t1) AS x GROUP BY c
)` from `test`.`t1` group by `test`.`t1`.`b`) `y`
DROP TABLE t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
index 17fd95ab1c8..679e50fcad9 100644
--- a/mysql-test/r/system_mysql_db.result
+++ b/mysql-test/r/system_mysql_db.result
@@ -110,6 +110,7 @@ user CREATE TABLE `user` (
`Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
+ `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
`ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
`ssl_cipher` blob NOT NULL,
`x509_issuer` blob NOT NULL,
@@ -201,7 +202,7 @@ proc CREATE TABLE `proc` (
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '',
- `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
`character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result
index 2bcd919e0db..14ef4f54f27 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -31,8 +31,8 @@ Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest_db1 wl2818_trg1 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 wl2818_trg2 INSERT NULL mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 wl2818_trg1 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 wl2818_trg2 INSERT def mysqltest_db1 t1 0 NULL INSERT INTO t2 VALUES(CURRENT_USER()) ROW AFTER NULL NULL OLD NEW NULL mysqltest_dfn@localhost latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER wl2818_trg1;
Warnings:
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 4476735735c..1a6494e03ad 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -1073,7 +1073,7 @@ NULL
SET @x=2;
UPDATE t1 SET i1 = @x;
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
SELECT @x;
@x
NULL
@@ -1086,8 +1086,8 @@ NULL
SET @x=4;
UPDATE t1 SET i1 = @x;
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
SELECT @x;
@x
NULL
@@ -1190,16 +1190,16 @@ create trigger t4_bu before update on t4 for each row set @t4_bu_called:=1|
insert into t1 values(10, 10)|
set @a:=1/0|
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select 1/0 from t1|
1/0
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
create trigger t1_bi before insert on t1 for each row set @a:=1/0|
insert into t1 values(20, 20)|
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
drop trigger t1_bi|
create trigger t1_bi before insert on t1 for each row
begin
@@ -1219,7 +1219,7 @@ end|
set @check=0, @t4_bi_called=0, @t4_bu_called=0|
insert into t1 values(30, 30)|
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select @check, @t4_bi_called, @t4_bu_called|
@check @t4_bi_called @t4_bu_called
2 1 1
@@ -2088,3 +2088,30 @@ SELECT * FROM t2;
a b
DROP TABLE t1, t2;
End of 5.1 tests.
+#
+# Bug#34453 Can't change size of file (Errcode: 1224)
+#
+DROP TRIGGER IF EXISTS t1_bi;
+DROP TRIGGER IF EXISTS t1_bd;
+DROP TABLE IF EXISTS t1;
+DROP TEMPORARY TABLE IF EXISTS t2;
+CREATE TABLE t1 (s1 INT);
+CREATE TEMPORARY TABLE t2 (s1 INT);
+CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0);
+CREATE TRIGGER t1_bd BEFORE DELETE ON t1 FOR EACH ROW DELETE FROM t2;
+INSERT INTO t1 VALUES (0);
+INSERT INTO t1 VALUES (0);
+SELECT * FROM t1;
+s1
+0
+0
+SELECT * FROM t2;
+s1
+0
+0
+# Reported to give ERROR 14 (HY000):
+# Can't change size of file (Errcode: 1224)
+# on Windows
+DELETE FROM t1;
+DROP TABLE t1;
+DROP TEMPORARY TABLE t2;
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result
index d66308a9bd7..c39e3d1c85d 100644
--- a/mysql-test/r/trigger_notembedded.result
+++ b/mysql-test/r/trigger_notembedded.result
@@ -117,7 +117,7 @@ CREATE DEFINER='mysqltest_inv'@'localhost'
TRIGGER trg1 BEFORE INSERT ON t1
FOR EACH ROW
SET @new_sum = 0;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
---> connection: default
use mysqltest_db1;
@@ -170,11 +170,11 @@ Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigge
SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-NULL mysqltest_db1 trg1 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg2 INSERT NULL mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg3 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@ latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg4 UPDATE NULL mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname latin1 latin1_swedish_ci latin1_swedish_ci
-NULL mysqltest_db1 trg5 DELETE NULL mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg1 INSERT def mysqltest_db1 t1 0 NULL SET @a = 1 ROW BEFORE NULL NULL OLD NEW NULL latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg2 INSERT def mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER NULL NULL OLD NEW NULL @ latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg3 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL @abc@def@@ latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg4 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL @hostname latin1 latin1_swedish_ci latin1_swedish_ci
+def mysqltest_db1 trg5 DELETE def mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci
---> connection: default
DROP USER mysqltest_dfn@localhost;
@@ -471,7 +471,7 @@ SELECT trigger_name FROM INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_schema = 'db1';
trigger_name
SHOW CREATE TRIGGER db1.trg;
-ERROR 42000: Access denied; you need the TRIGGER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the TRIGGER privilege(s) for this operation
DROP USER 'no_rights'@'localhost';
DROP DATABASE db1;
End of 5.1 tests.
diff --git a/mysql-test/r/type_binary.result b/mysql-test/r/type_binary.result
index 432c58272a2..01841bf27fc 100644
--- a/mysql-test/r/type_binary.result
+++ b/mysql-test/r/type_binary.result
@@ -47,7 +47,7 @@ create table t1 (s1 binary(2) primary key);
insert into t1 values (0x01);
insert into t1 values (0x0120);
insert into t1 values (0x0100);
-ERROR 23000: Duplicate entry '' for key 'PRIMARY'
+ERROR 23000: Duplicate entry '\x01\x00' for key 'PRIMARY'
select hex(s1) from t1 order by s1;
hex(s1)
0100
diff --git a/mysql-test/r/type_bit.result b/mysql-test/r/type_bit.result
index 51feab0a421..e8c8c6c65a4 100644
--- a/mysql-test/r/type_bit.result
+++ b/mysql-test/r/type_bit.result
@@ -71,7 +71,7 @@ hex(a)
1
1
alter table t1 add unique (a);
-ERROR 23000: Duplicate entry '' for key 'a'
+ERROR 23000: Duplicate entry '\x00' for key 'a'
drop table t1;
create table t1 (a bit(2));
insert into t1 values (b'00'), (b'01'), (b'10'), (b'100');
diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result
index f96e07b0c5e..92be736ff9a 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -276,3 +276,25 @@ a
0000-00-01
drop table t1;
End of 5.1 tests
+#
+# Bug #33629: last_day function can return null, but has 'not null'
+# flag set for result
+#
+SELECT 1 FROM (SELECT LAST_DAY('0')) a;
+1
+1
+Warnings:
+Warning 1292 Incorrect datetime value: '0'
+SELECT 1 FROM (SELECT MAKEDATE(2011,0)) a;
+1
+1
+CREATE TABLE t1 AS
+SELECT LAST_DAY('1970-01-01') AS f1,
+MAKEDATE(1970, 1) AS f2;
+DESCRIBE t1;
+Field Type Null Key Default Extra
+f1 date YES NULL
+f2 date YES NULL
+DROP TABLE t1;
+#
+End of 6.0 tests
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index b6281443751..054fda90c02 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -517,7 +517,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1
-Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from `test`.`t1` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where 0))
+Note 1003 select '1' AS `id`,'2007-04-25 18:30:22' AS `cur_date` from dual where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t1` `x1` where 0))
select * from t1
where id in (select id from t1 as x1 where (t1.cur_date is null));
id cur_date
@@ -529,7 +529,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1
-Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from `test`.`t2` where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where 0))
+Note 1003 select '1' AS `id`,'2007-04-25' AS `cur_date` from dual where <in_optimizer>('1',<exists>(select 1 AS `Not_used` from `test`.`t2` `x1` where 0))
select * from t2
where id in (select id from t2 as x1 where (t2.cur_date is null));
id cur_date
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index 76c5ea8f756..67898b7f335 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -3,13 +3,13 @@ SET SQL_WARNINGS=1;
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
datatype_id int(11) DEFAULT '0' NOT NULL,
-minvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
-maxvalue decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
+min_value decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
+max_value decimal(20,10) DEFAULT '0.0000000000' NOT NULL,
valuename varchar(20),
forecolor int(11),
backcolor int(11),
PRIMARY KEY (id),
-UNIQUE datatype_id (datatype_id, minvalue, maxvalue)
+UNIQUE datatype_id (datatype_id, min_value, max_value)
);
INSERT INTO t1 VALUES ( '1', '4', '0.0000000000', '0.0000000000', 'Ei saja', '0', '16776960');
INSERT INTO t1 VALUES ( '2', '4', '1.0000000000', '1.0000000000', 'Sajab', '16777215', '255');
@@ -143,12 +143,12 @@ INSERT INTO t1 VALUES ( '139', '21', '326.0000000000', '326.0000000000', 'Lumine
INSERT INTO t1 VALUES ( '143', '16', '-4.9000000000', '-0.1000000000', '', NULL, '15774720');
INSERT INTO t1 VALUES ( '145', '15', '0.0000000000', '1.9000000000', '', '0', '16769024');
INSERT INTO t1 VALUES ( '146', '16', '0.0000000000', '1.9000000000', '', '0', '16769024');
-select * from t1 where minvalue<=1 and maxvalue>=-1 and datatype_id=16;
-id datatype_id minvalue maxvalue valuename forecolor backcolor
+select * from t1 where min_value<=1 and max_value>=-1 and datatype_id=16;
+id datatype_id min_value max_value valuename forecolor backcolor
143 16 -4.9000000000 -0.1000000000 NULL 15774720
146 16 0.0000000000 1.9000000000 0 16769024
-select * from t1 where minvalue<=-1 and maxvalue>=-1 and datatype_id=16;
-id datatype_id minvalue maxvalue valuename forecolor backcolor
+select * from t1 where min_value<=-1 and max_value>=-1 and datatype_id=16;
+id datatype_id min_value max_value valuename forecolor backcolor
143 16 -4.9000000000 -0.1000000000 NULL 15774720
drop table t1;
create table t1 (a decimal(10,2));
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 70ee3a56cf3..172b343e003 100644
--- a/mysql-test/r/type_newdecimal.result
+++ b/mysql-test/r/type_newdecimal.result
@@ -185,7 +185,7 @@ select 1e10/0e0;
1e10/0e0
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
create table wl1612 (col1 int, col2 decimal(38,10), col3 numeric(38,10));
insert into wl1612 values(1,12345678901234567890.1234567890,12345678901234567890.1234567890);
select * from wl1612;
@@ -205,27 +205,27 @@ NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
select col2/0 from wl1612;
col2/0
NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
select col3/0 from wl1612;
col3/0
NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
insert into wl1612 values(5,5000.0005,5000.0005);
insert into wl1612 values(6,5000.0005,5000.0005);
select sum(col2),sum(col3) from wl1612;
@@ -788,12 +788,12 @@ select 1 / 1E-500;
1 / 1E-500
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
select 1 / 0;
1 / 0
NULL
Warnings:
-Error 1365 Division by 0
+Warning 1365 Division by 0
set sql_mode='ansi,traditional';
CREATE TABLE Sow6_2f (col1 NUMERIC(4,2));
INSERT INTO Sow6_2f VALUES (10.55);
@@ -819,11 +819,11 @@ NULL
NULL
NULL
Warnings:
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
-Error 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
+Warning 1365 Division by 0
INSERT INTO Sow6_2f VALUES ('a59b');
ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1
drop table Sow6_2f;
@@ -838,12 +838,12 @@ select 9999999999999999999999999999999999999999999999999999999999999999999999999
x
99999999999999999999999999999999999999999999999999999999999999999
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x;
x
100000000000000000000000000000000000000000000000000000000000000000
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
select 0.190287977636363637 + 0.040372670 * 0 - 0;
0.190287977636363637 + 0.040372670 * 0 - 0
0.190287977636363637
@@ -1380,15 +1380,15 @@ create table t1 (c1 decimal(64));
insert into t1 values(
89000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value 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 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
Warning 1264 Out of range value for column 'c1' at row 1
insert into t1 values(1e100);
Warnings:
@@ -1432,7 +1432,7 @@ select cast(19999999999999999999 as unsigned);
cast(19999999999999999999 as unsigned)
18446744073709551615
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
create table t1(a decimal(18));
insert into t1 values(123456789012345678);
alter table t1 modify column a decimal(19);
@@ -1444,12 +1444,12 @@ select cast(11.1234 as DECIMAL(3,2));
cast(11.1234 as DECIMAL(3,2))
9.99
Warnings:
-Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
select * from (select cast(11.1234 as DECIMAL(3,2))) t;
cast(11.1234 as DECIMAL(3,2))
9.99
Warnings:
-Error 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(11.1234 as DECIMAL(3,2))' at row 1
select cast(a as DECIMAL(3,2))
from (select 11.1233 as a
UNION select 11.1234
@@ -1460,9 +1460,9 @@ cast(a as DECIMAL(3,2))
9.99
9.99
Warnings:
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
select cast(a as DECIMAL(3,2)), count(*)
from (select 11.1233 as a
UNION select 11.1234
@@ -1471,10 +1471,10 @@ UNION select 12.1234
cast(a as DECIMAL(3,2)) count(*)
9.99 3
Warnings:
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
-Error 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
+Warning 1264 Out of range value for column 'cast(a as DECIMAL(3,2))' at row 1
create table t1 (s varchar(100));
insert into t1 values (0.00000000010000000000000000364321973154977415791655470655996396089904010295867919921875);
drop table t1;
@@ -1560,7 +1560,7 @@ select cast(143.481 as decimal(2,1));
cast(143.481 as decimal(2,1))
9.9
Warnings:
-Error 1264 Out of range value for column 'cast(143.481 as decimal(2,1))' at row 1
+Warning 1264 Out of range value for column 'cast(143.481 as decimal(2,1))' at row 1
select cast(-3.4 as decimal(2,1));
cast(-3.4 as decimal(2,1))
-3.4
@@ -1568,12 +1568,12 @@ select cast(99.6 as decimal(2,0));
cast(99.6 as decimal(2,0))
99
Warnings:
-Error 1264 Out of range value for column 'cast(99.6 as decimal(2,0))' at row 1
+Warning 1264 Out of range value for column 'cast(99.6 as decimal(2,0))' at row 1
select cast(-13.4 as decimal(2,1));
cast(-13.4 as decimal(2,1))
-9.9
Warnings:
-Error 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
+Warning 1264 Out of range value for column 'cast(-13.4 as decimal(2,1))' at row 1
select cast(98.6 as decimal(2,0));
cast(98.6 as decimal(2,0))
99
@@ -1674,7 +1674,7 @@ CREATE TABLE t1 SELECT
/* 82 */ 1000000000000000000000000000000000000000000000000000000000000000000000000000000001
AS c1;
Warnings:
-Error 1292 Truncated incorrect DECIMAL value: ''
+Warning 1292 Truncated incorrect DECIMAL value: ''
DESC t1;
Field Type Null Key Default Extra
c1 decimal(65,0) NO 0
@@ -1799,7 +1799,7 @@ CREATE TABLE t1 (a DECIMAL(30,30));
INSERT INTO t1 VALUES (0.1),(0.2),(0.3);
CREATE TABLE t2 SELECT MIN(a + 0.0000000000000000000000000000001) AS c1 FROM t1;
Warnings:
-Note 1265 Data truncated for column 'c1' at row 3
+Note 1265 Data truncated for column 'c1' at row 4
DESC t2;
Field Type Null Key Default Extra
c1 decimal(32,30) YES NULL
diff --git a/mysql-test/r/type_varchar.result b/mysql-test/r/type_varchar.result
index 96042a91bae..6b614960422 100644
--- a/mysql-test/r/type_varchar.result
+++ b/mysql-test/r/type_varchar.result
@@ -489,3 +489,23 @@ Warnings:
Warning 1292 Truncated incorrect INTEGER value: '1a'
Warning 1292 Truncated incorrect INTEGER value: 't'
DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+5 = a
+1
+0
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 's'
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(16));
+INSERT INTO t1 VALUES ('5'), ('s'), ('');
+SELECT 5 = a FROM t1;
+5 = a
+1
+0
+0
+Warnings:
+Warning 1292 Truncated incorrect DOUBLE value: 's '
+DROP TABLE t1;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index c1cd1840df8..0a999fb18f3 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -812,16 +812,16 @@ select @@lc_time_names;
@@lc_time_names
en_US
LC_TIME_NAMES: testing locale with the last ID:
-set lc_time_names=108;
+set lc_time_names=109;
select @@lc_time_names;
@@lc_time_names
-zh_HK
+el_GR
LC_TIME_NAMES: testing a number beyond the valid ID range:
-set lc_time_names=109;
-ERROR HY000: Unknown locale: '109'
+set lc_time_names=110;
+ERROR HY000: Unknown locale: '110'
select @@lc_time_names;
@@lc_time_names
-zh_HK
+el_GR
LC_TIME_NAMES: testing that 0 is en_US:
set lc_time_names=0;
select @@lc_time_names;
@@ -864,7 +864,7 @@ select @@query_prealloc_size = @test;
@@query_prealloc_size = @test
1
set global sql_mode=repeat('a',80);
-ERROR 42000: Variable 'sql_mode' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+ERROR 42000: Variable 'sql_mode' can't be set to the value of 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
End of 4.1 tests
create table t1 (a int);
select a into @x from t1;
@@ -1176,18 +1176,18 @@ ERROR HY000: Variable 'init_file' is a read only variable
SET @@global.init_file= 'x';
ERROR HY000: Variable 'init_file' is a read only variable
#
-SHOW VARIABLES like 'language';
+SHOW VARIABLES like 'lc_messages_dir';
Variable_name Value
-language #
-SELECT @@session.language;
-ERROR HY000: Variable 'language' is a GLOBAL variable
-SELECT @@global.language;
-@@global.language
+lc_messages_dir #
+SELECT @@session.lc_messages_dir;
+ERROR HY000: Variable 'lc_messages_dir' is a GLOBAL variable
+SELECT @@global.lc_messages_dir;
+@@global.lc_messages_dir
#
-SET @@session.language= 'x';
-ERROR HY000: Variable 'language' is a read only variable
-SET @@global.language= 'x';
-ERROR HY000: Variable 'language' is a read only variable
+SET @@session.lc_messages_dir= 'x';
+ERROR HY000: Variable 'lc_messages_dir' is a read only variable
+SET @@global.lc_messages_dir= 'x';
+ERROR HY000: Variable 'lc_messages_dir' is a read only variable
#
SHOW VARIABLES like 'large_page_size';
Variable_name Value
@@ -1488,3 +1488,168 @@ SELECT @@GLOBAL.max_binlog_cache_size;
5368709120
SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
End of 5.1 tests
+
+#
+# Bug#34828: OF is taken as OFF and a value of 0 is set for variable SQL_notes.
+#
+
+# Checking sql_notes...
+SET @sql_notes_saved = @@sql_notes;
+
+SET @@sql_notes = ON;
+SELECT @@sql_notes;
+@@sql_notes
+1
+
+SET @@sql_notes = OF;
+ERROR 42000: Variable 'sql_notes' can't be set to the value of 'OF'
+SELECT @@sql_notes;
+@@sql_notes
+1
+
+SET @@sql_notes = OFF;
+SELECT @@sql_notes;
+@@sql_notes
+0
+
+SET @@sql_notes = @sql_notes_saved;
+
+# Checking delay_key_write...
+SET @delay_key_write_saved = @@delay_key_write;
+
+SET GLOBAL delay_key_write = ON;
+SELECT @@delay_key_write;
+@@delay_key_write
+ON
+
+SET GLOBAL delay_key_write = OF;
+ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'OF'
+SELECT @@delay_key_write;
+@@delay_key_write
+ON
+
+SET GLOBAL delay_key_write = AL;
+ERROR 42000: Variable 'delay_key_write' can't be set to the value of 'AL'
+SELECT @@delay_key_write;
+@@delay_key_write
+ON
+
+SET GLOBAL delay_key_write = OFF;
+SELECT @@delay_key_write;
+@@delay_key_write
+OFF
+
+SET GLOBAL delay_key_write = ALL;
+SELECT @@delay_key_write;
+@@delay_key_write
+ALL
+
+SET GLOBAL delay_key_write = @delay_key_write_saved;
+
+# Checking sql_safe_updates...
+SET @sql_safe_updates_saved = @@sql_safe_updates;
+
+SET @@sql_safe_updates = ON;
+SELECT @@sql_safe_updates;
+@@sql_safe_updates
+1
+
+SET @@sql_safe_updates = OF;
+ERROR 42000: Variable 'sql_safe_updates' can't be set to the value of 'OF'
+SELECT @@sql_safe_updates;
+@@sql_safe_updates
+1
+
+SET @@sql_safe_updates = OFF;
+SELECT @@sql_safe_updates;
+@@sql_safe_updates
+0
+
+SET @@sql_safe_updates = @sql_safe_updates_saved;
+
+# Checking foreign_key_checks...
+SET @foreign_key_checks_saved = @@foreign_key_checks;
+
+SET @@foreign_key_checks = ON;
+SELECT @@foreign_key_checks;
+@@foreign_key_checks
+1
+
+SET @@foreign_key_checks = OF;
+ERROR 42000: Variable 'foreign_key_checks' can't be set to the value of 'OF'
+SELECT @@foreign_key_checks;
+@@foreign_key_checks
+1
+
+SET @@foreign_key_checks = OFF;
+SELECT @@foreign_key_checks;
+@@foreign_key_checks
+0
+
+SET @@foreign_key_checks = @foreign_key_checks_saved;
+
+# Checking unique_checks...
+SET @unique_checks_saved = @@unique_checks;
+
+SET @@unique_checks = ON;
+SELECT @@unique_checks;
+@@unique_checks
+1
+
+SET @@unique_checks = OF;
+ERROR 42000: Variable 'unique_checks' can't be set to the value of 'OF'
+SELECT @@unique_checks;
+@@unique_checks
+1
+
+SET @@unique_checks = OFF;
+SELECT @@unique_checks;
+@@unique_checks
+0
+
+SET @@unique_checks = @unique_checks_saved;
+
+# Checking sql_buffer_result...
+SET @sql_buffer_result_saved = @@sql_buffer_result;
+
+SET @@sql_buffer_result = ON;
+SELECT @@sql_buffer_result;
+@@sql_buffer_result
+1
+
+SET @@sql_buffer_result = OF;
+ERROR 42000: Variable 'sql_buffer_result' can't be set to the value of 'OF'
+SELECT @@sql_buffer_result;
+@@sql_buffer_result
+1
+
+SET @@sql_buffer_result = OFF;
+SELECT @@sql_buffer_result;
+@@sql_buffer_result
+0
+
+SET @@sql_buffer_result = @sql_buffer_result_saved;
+
+# Checking sql_quote_show_create...
+SET @sql_quote_show_create_saved = @@sql_quote_show_create;
+
+SET @@sql_quote_show_create = ON;
+SELECT @@sql_quote_show_create;
+@@sql_quote_show_create
+1
+
+SET @@sql_quote_show_create = OF;
+ERROR 42000: Variable 'sql_quote_show_create' can't be set to the value of 'OF'
+SELECT @@sql_quote_show_create;
+@@sql_quote_show_create
+1
+
+SET @@sql_quote_show_create = OFF;
+SELECT @@sql_quote_show_create;
+@@sql_quote_show_create
+0
+
+SET @@sql_quote_show_create = @sql_quote_show_create_saved;
+
+# End of Bug#34828.
+
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index b5e374aaf8c..69bcf349f51 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1111,8 +1111,8 @@ insert into v1 values(3);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (2),(3),(0);
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@@ -1125,8 +1125,8 @@ create table t2 (a int);
insert into t2 values (2),(3),(0);
insert ignore into v1 SELECT a from t2;
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1 order by a desc;
a
1
@@ -1148,7 +1148,7 @@ a
update v1 set a=a+1;
update ignore v1,t2 set v1.a=v1.a+1 where v1.a=t2.a;
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@@ -1182,7 +1182,7 @@ insert into v1 values (1) on duplicate key update a=2;
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (1) on duplicate key update a=2;
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
a
1
@@ -1283,7 +1283,7 @@ insert ignore into v1 values (6);
ERROR HY000: CHECK OPTION failed 'test.v1'
insert ignore into v1 values (6),(3);
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1;
s1
3
@@ -1328,9 +1328,9 @@ delete from t1;
load data infile '../../std_data/loaddata3.dat' ignore into table v1 fields terminated by '' enclosed by '' ignore 1 lines;
Warnings:
Warning 1366 Incorrect integer value: 'error ' for column 'a' at row 3
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 4
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
select * from t1 order by a,b;
a b
1 row 1
@@ -1354,7 +1354,7 @@ concat('|',a,'|') concat('|',b,'|')
delete from t1;
load data infile '../../std_data/loaddata2.dat' ignore into table v1 fields terminated by ',' enclosed by '''';
Warnings:
-Error 1369 CHECK OPTION failed 'test.v1'
+Warning 1369 CHECK OPTION failed 'test.v1'
Warning 1261 Row 2 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from t1;
concat('|',a,'|') concat('|',b,'|')
@@ -2342,11 +2342,11 @@ CREATE VIEW v2 AS SELECT t3.* FROM t1,t3 WHERE t1.a=t3.a;
EXPLAIN SELECT t1.* FROM t1 JOIN t2 WHERE t1.a=t2.a AND t1.b=t2.b AND t1.a=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
-1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index
+1 SIMPLE t2 ref a a 10 const,test.t1.b 1 Using where; Using index
EXPLAIN SELECT * FROM v1 WHERE a=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
-1 SIMPLE t2 ref a a 10 const,test.t1.b 2 Using where; Using index
+1 SIMPLE t2 ref a a 10 const,test.t1.b 1 Using where; Using index
EXPLAIN SELECT * FROM v2 WHERE a=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 5 const 1 Using where; Using index
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 2d5c515d0b5..65fbf2d87b6 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -16,7 +16,7 @@ create table mysqltest.t2 (a int, b int);
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
create definer=root@localhost view v1 as select * from mysqltest.t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
create view v1 as select * from mysqltest.t1;
alter view v1 as select * from mysqltest.t1;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 'v1'
@@ -779,11 +779,11 @@ GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost;
GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
GRANT SELECT ON db26813.t1 TO u26813@localhost;
ALTER VIEW v1 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
ALTER VIEW v2 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
ALTER VIEW v3 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
SHOW CREATE VIEW v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
@@ -799,17 +799,17 @@ CREATE USER u29908_1@localhost;
CREATE DEFINER = u29908_1@localhost VIEW v1 AS SELECT f1 FROM t1;
CREATE DEFINER = u29908_1@localhost SQL SECURITY INVOKER VIEW v2 AS
SELECT f1 FROM t1;
-GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
-GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
+GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v1 TO u29908_1@localhost;
+GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_1@localhost;
GRANT SELECT ON mysqltest_29908.t1 TO u29908_1@localhost;
CREATE USER u29908_2@localhost;
-GRANT DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
-GRANT DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
+GRANT SELECT, DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
+GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
ALTER VIEW v1 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
ALTER VIEW v2 AS SELECT f2 FROM t1;
-ERROR 42000: Access denied; you need the SUPER privilege for this operation
+ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
SHOW CREATE VIEW v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index 8a87852d582..e2bce537179 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -35,7 +35,7 @@ Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
insert into t1 values ("hej"),("då");
Warnings:
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
-Warning 1366 Incorrect integer value: 'd?' for column 'a' at row 2
+Warning 1366 Incorrect integer value: 'då' for column 'a' at row 2
set SQL_WARNINGS=1;
insert into t1 values ("hej");
Warnings:
@@ -43,7 +43,7 @@ Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
insert into t1 values ("hej"),("då");
Warnings:
Warning 1366 Incorrect integer value: 'hej' for column 'a' at row 1
-Warning 1366 Incorrect integer value: 'd?' for column 'a' at row 2
+Warning 1366 Incorrect integer value: 'då' for column 'a' at row 2
drop table t1;
set SQL_WARNINGS=0;
drop temporary table if exists not_exists;