summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/1st.result1
-rw-r--r--mysql-test/r/alias.result139
-rw-r--r--mysql-test/r/alter_table.result8
-rw-r--r--mysql-test/r/archive.result13
-rw-r--r--mysql-test/r/archive_gis.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/bug46080.result2
-rw-r--r--mysql-test/r/cache_innodb.result2
-rw-r--r--mysql-test/r/cast.result12
-rw-r--r--mysql-test/r/change_user.result2
-rw-r--r--mysql-test/r/commit_1innodb.result25
-rw-r--r--mysql-test/r/compare.result4
-rw-r--r--mysql-test/r/create.result38
-rw-r--r--mysql-test/r/csv.result56
-rw-r--r--mysql-test/r/ctype_big5.result278
-rw-r--r--mysql-test/r/ctype_collate.result30
-rw-r--r--mysql-test/r/ctype_cp1251.result11
-rw-r--r--mysql-test/r/ctype_cp932_binlog_stm.result350
-rw-r--r--mysql-test/r/ctype_errors.result32
-rwxr-xr-xmysql-test/r/ctype_eucjpms.result564
-rw-r--r--mysql-test/r/ctype_euckr.result347
-rw-r--r--mysql-test/r/ctype_gb2312.result313
-rw-r--r--mysql-test/r/ctype_gbk.result325
-rw-r--r--mysql-test/r/ctype_ldml.result76
-rw-r--r--mysql-test/r/ctype_recoding.result4
-rw-r--r--mysql-test/r/ctype_sjis.result287
-rw-r--r--mysql-test/r/ctype_ucs2_def.result2
-rw-r--r--mysql-test/r/ctype_ujis.result532
-rw-r--r--mysql-test/r/ctype_utf8.result227
-rw-r--r--mysql-test/r/date_formats.result129
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result146
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result146
-rw-r--r--mysql-test/r/debug_sync.result2
-rw-r--r--mysql-test/r/delayed.result24
-rw-r--r--mysql-test/r/delete.result143
-rw-r--r--mysql-test/r/deprecated_features.result26
-rw-r--r--mysql-test/r/derived.result2
-rw-r--r--mysql-test/r/dirty_close.result10
-rw-r--r--mysql-test/r/drop-no_root.result28
-rw-r--r--mysql-test/r/drop.result36
-rw-r--r--mysql-test/r/drop_debug.result21
-rw-r--r--mysql-test/r/errors.result65
-rw-r--r--mysql-test/r/events_1.result40
-rw-r--r--mysql-test/r/events_2.result16
-rw-r--r--mysql-test/r/events_bugs.result43
-rw-r--r--mysql-test/r/events_grant.result42
-rw-r--r--mysql-test/r/events_scheduling.result19
-rw-r--r--mysql-test/r/exampledb.result8
-rw-r--r--mysql-test/r/explain.result26
-rw-r--r--mysql-test/r/flush2.result2
-rw-r--r--mysql-test/r/flush_block_commit_notembedded.result4
-rw-r--r--mysql-test/r/fulltext.result10
-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_group.result18
-rw-r--r--mysql-test/r/func_isnull.result5
-rw-r--r--mysql-test/r/func_like.result2
-rw-r--r--mysql-test/r/func_math.result57
-rw-r--r--mysql-test/r/func_regexp.result2
-rw-r--r--mysql-test/r/func_sapdb.result32
-rw-r--r--mysql-test/r/func_str.result393
-rw-r--r--mysql-test/r/func_test.result2
-rw-r--r--mysql-test/r/func_time.result9
-rw-r--r--mysql-test/r/gis.result12
-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_by.result3
-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_dynamic_loading.require2
-rw-r--r--mysql-test/r/have_example_plugin.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/have_simple_parser.require2
-rw-r--r--mysql-test/r/have_udf_example.require2
-rw-r--r--mysql-test/r/having.result2
-rw-r--r--mysql-test/r/index_merge_innodb.result326
-rw-r--r--mysql-test/r/index_merge_myisam.result23
-rw-r--r--mysql-test/r/information_schema-big.result93
-rw-r--r--mysql-test/r/information_schema.result319
-rw-r--r--mysql-test/r/information_schema_db.result19
-rw-r--r--mysql-test/r/information_schema_inno.result26
-rw-r--r--mysql-test/r/information_schema_parameters.result457
-rw-r--r--mysql-test/r/information_schema_part.result56
-rw-r--r--mysql-test/r/information_schema_routines.result737
-rw-r--r--mysql-test/r/innodb-autoinc.result78
-rw-r--r--mysql-test/r/innodb-consistent.result35
-rw-r--r--mysql-test/r/innodb.result23
-rw-r--r--mysql-test/r/innodb_bug34300.result5
-rw-r--r--mysql-test/r/innodb_bug42101-nonzero.result4
-rw-r--r--mysql-test/r/innodb_bug42101.result4
-rw-r--r--mysql-test/r/innodb_bug44369.result14
-rw-r--r--mysql-test/r/innodb_bug44571.result9
-rw-r--r--mysql-test/r/innodb_bug46000.result14
-rw-r--r--mysql-test/r/innodb_gis.result8
-rw-r--r--mysql-test/r/innodb_mysql.result20
-rw-r--r--mysql-test/r/insert.result114
-rw-r--r--mysql-test/r/insert_notembedded.result1
-rw-r--r--mysql-test/r/ipv4_as_ipv6.result179
-rw-r--r--mysql-test/r/ipv4_as_ipv6_win.result32
-rw-r--r--mysql-test/r/ipv6.result264
-rw-r--r--mysql-test/r/ipv6_win.result88
-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/key_cache.result21
-rw-r--r--mysql-test/r/loaddata.result6
-rw-r--r--mysql-test/r/loadxml.result75
-rw-r--r--mysql-test/r/locale.result63
-rw-r--r--mysql-test/r/lock.result6
-rw-r--r--mysql-test/r/lock_multi.result10
-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/log_tables.result11
-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/myisam.result2
-rw-r--r--mysql-test/r/myisam_crash_before_flush_keys.result2
-rw-r--r--mysql-test/r/myisampack.result33
-rw-r--r--mysql-test/r/mysql.result202
-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/mysqlbinlog.result278
-rw-r--r--mysql-test/r/mysqlbinlog2.result823
-rw-r--r--mysql-test/r/mysqlbinlog_row.result2
-rw-r--r--mysql-test/r/mysqlbinlog_row_innodb.result80
-rw-r--r--mysql-test/r/mysqlbinlog_row_myisam.result48
-rw-r--r--mysql-test/r/mysqlbinlog_row_trans.result151
-rw-r--r--mysql-test/r/mysqlcheck.result11
-rw-r--r--mysql-test/r/mysqld--help-notwin.result992
-rw-r--r--mysql-test/r/mysqld--help-win.result998
-rw-r--r--mysql-test/r/mysqldump.result36
-rw-r--r--mysql-test/r/mysqlshow.result18
-rw-r--r--mysql-test/r/not_partition.result34
-rw-r--r--mysql-test/r/odbc.result4
-rw-r--r--mysql-test/r/optimizer_switch_eng_cond_pushdown1.result5
-rw-r--r--mysql-test/r/optimizer_switch_eng_cond_pushdown2.result5
-rw-r--r--mysql-test/r/outfile.resultbin2149 -> 2137 bytes
-rw-r--r--mysql-test/r/parser.result4
-rw-r--r--mysql-test/r/partition.result64
-rw-r--r--mysql-test/r/partition_archive.result22
-rw-r--r--mysql-test/r/partition_column.result602
-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.result46
-rw-r--r--mysql-test/r/partition_innodb_builtin.result39
-rw-r--r--mysql-test/r/partition_innodb_stmt.result2
-rw-r--r--mysql-test/r/partition_key_cache.result415
-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.result130
-rw-r--r--mysql-test/r/partition_sync.result25
-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.result17
-rw-r--r--mysql-test/r/profiling.result9
-rw-r--r--mysql-test/r/ps.result171
-rw-r--r--mysql-test/r/ps_1general.result6
-rw-r--r--mysql-test/r/ps_2myisam.result116
-rw-r--r--mysql-test/r/ps_3innodb.result116
-rw-r--r--mysql-test/r/ps_4heap.result110
-rw-r--r--mysql-test/r/ps_5merge.result232
-rw-r--r--mysql-test/r/query_cache.result132
-rw-r--r--mysql-test/r/query_cache_disabled.result14
-rw-r--r--mysql-test/r/query_cache_notembedded.result1
-rw-r--r--mysql-test/r/query_cache_ps_no_prot.result49
-rw-r--r--mysql-test/r/query_cache_ps_ps_prot.result49
-rw-r--r--mysql-test/r/range.result6
-rw-r--r--mysql-test/r/rpl_mysqldump_slave.result17
-rw-r--r--mysql-test/r/schema.result1
-rw-r--r--mysql-test/r/select.result103
-rw-r--r--mysql-test/r/select_safe.result4
-rw-r--r--mysql-test/r/show_check.result400
-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-error.result55
-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-ucs2.result112
-rw-r--r--mysql-test/r/sp-vars.result97
-rw-r--r--mysql-test/r/sp.result273
-rw-r--r--mysql-test/r/sp_notembedded.result2
-rw-r--r--mysql-test/r/sp_trans.result31
-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/status.result6
-rw-r--r--mysql-test/r/strict.result68
-rw-r--r--mysql-test/r/subselect.result299
-rw-r--r--mysql-test/r/subselect3.result52
-rw-r--r--mysql-test/r/system_mysql_db.result3
-rw-r--r--mysql-test/r/trigger-compat.result6
-rw-r--r--mysql-test/r/trigger.result88
-rw-r--r--mysql-test/r/trigger_notembedded.result16
-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_blob.result34
-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.result26
-rw-r--r--mysql-test/r/type_float.result82
-rw-r--r--mysql-test/r/type_newdecimal.result200
-rw-r--r--mysql-test/r/type_ranges.result4
-rw-r--r--mysql-test/r/type_time.result25
-rw-r--r--mysql-test/r/type_timestamp.result26
-rw-r--r--mysql-test/r/type_varchar.result25
-rw-r--r--mysql-test/r/udf.result15
-rw-r--r--mysql-test/r/union.result80
-rw-r--r--mysql-test/r/user_limits.result2
-rw-r--r--mysql-test/r/user_var-binlog.result22
-rw-r--r--mysql-test/r/user_var.result2
-rw-r--r--mysql-test/r/variables.result300
-rw-r--r--mysql-test/r/view.result153
-rw-r--r--mysql-test/r/view_grant.result20
-rw-r--r--mysql-test/r/warnings.result7
-rw-r--r--mysql-test/r/warnings_engine_disabled.result4
235 files changed, 19511 insertions, 3037 deletions
diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result
index 4a82f8c66e9..ae9989ce563 100644
--- a/mysql-test/r/1st.result
+++ b/mysql-test/r/1st.result
@@ -3,6 +3,7 @@ Database
information_schema
mtr
mysql
+performance_schema
test
show tables in mysql;
Tables_in_mysql
diff --git a/mysql-test/r/alias.result b/mysql-test/r/alias.result
index 6f0315da234..3190e8994e5 100644
--- a/mysql-test/r/alias.result
+++ b/mysql-test/r/alias.result
@@ -73,3 +73,142 @@ UPDATE t1 SET t1.xstatus_vor = Greatest(t1.xstatus_vor,1) WHERE t1.aufnr =
"40004712" AND t1.plnfl = "000001" AND t1.vornr > "0010" ORDER BY t1.vornr
ASC LIMIT 1;
drop table t1;
+drop table if exists t1,t2,t3;
+create table t1 (a int, b int, c int);
+create table t2 (d int);
+create table t3 (a1 int, b1 int, c1 int);
+insert into t1 values(1,2,3);
+insert into t1 values(11,22,33);
+insert into t2 values(99);
+select t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+select t2.* as 'with_alias' from t2;
+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 'as 'with_alias' from t2' at line 1
+select t1.*, t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+select t1.* as 'with_alias', t1.* from t1;
+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 'as 'with_alias', t1.* from t1' at line 1
+select t1.* as 'with_alias', t1.* as 'alias2' from t1;
+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 'as 'with_alias', t1.* as 'alias2' from t1' at line 1
+select t1.* as 'with_alias', a, t1.* as 'alias2' from t1;
+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 'as 'with_alias', a, t1.* as 'alias2' from t1' at line 1
+select a, t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+select t1.* as 'with_alias', a from t1;
+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 'as 'with_alias', a from t1' at line 1
+select a, t1.* as 'with_alias', b from t1;
+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 'as 'with_alias', b from t1' at line 1
+select (select d from t2 where d > a), t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+select t1.* as 'with_alias', (select a from t2 where d > a) from t1;
+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 'as 'with_alias', (select a from t2 where d > a) from t1' at line 1
+select a as 'x', t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+select t1.* as 'with_alias', a as 'x' from t1;
+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 'as 'with_alias', a as 'x' from t1' at line 1
+select a as 'x', t1.* as 'with_alias', b as 'x' from t1;
+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 'as 'with_alias', b as 'x' from t1' at line 1
+select (select d from t2 where d > a) as 'x', t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+select t1.* as 'with_alias', (select a from t2 where d > a) as 'x' from t1;
+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 'as 'with_alias', (select a from t2 where d > a) as 'x' from t1' at line 1
+select (select t2.* as 'x' from t2) from t1;
+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 'as 'x' from t2) from t1' at line 1
+select a, (select t2.* as 'x' from t2) from t1;
+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 'as 'x' from t2) from t1' at line 1
+select t1.*, (select t2.* as 'x' from t2) from t1;
+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 'as 'x' from t2) from t1' at line 1
+insert into t3 select t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+insert into t3 select t2.* as 'with_alias', 1, 2 from t2;
+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 'as 'with_alias', 1, 2 from t2' at line 1
+insert into t3 select t2.* as 'with_alias', d as 'x', d as 'z' from t2;
+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 'as 'with_alias', d as 'x', d as 'z' from t2' at line 1
+insert into t3 select t2.*, t2.* as 'with_alias', 3 from t2;
+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 'as 'with_alias', 3 from t2' at line 1
+create table t3 select t1.* as 'with_alias' from t1;
+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 'as 'with_alias' from t1' at line 1
+create table t3 select t2.* as 'with_alias', 1, 2 from t2;
+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 'as 'with_alias', 1, 2 from t2' at line 1
+create table t3 select t2.* as 'with_alias', d as 'x', d as 'z' from t2;
+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 'as 'with_alias', d as 'x', d as 'z' from t2' at line 1
+create table t3 select t2.*, t2.* as 'with_alias', 3 from t2;
+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 'as 'with_alias', 3 from t2' at line 1
+select t1.* from t1;
+a b c
+1 2 3
+11 22 33
+select t2.* from t2;
+d
+99
+select t1.*, t1.* from t1;
+a b c a b c
+1 2 3 1 2 3
+11 22 33 11 22 33
+select t1.*, a, t1.* from t1;
+a b c a a b c
+1 2 3 1 1 2 3
+11 22 33 11 11 22 33
+select a, t1.* from t1;
+a a b c
+1 1 2 3
+11 11 22 33
+select t1.*, a from t1;
+a b c a
+1 2 3 1
+11 22 33 11
+select a, t1.*, b from t1;
+a a b c b
+1 1 2 3 2
+11 11 22 33 22
+select (select d from t2 where d > a), t1.* from t1;
+(select d from t2 where d > a) a b c
+99 1 2 3
+99 11 22 33
+select t1.*, (select a from t2 where d > a) from t1;
+a b c (select a from t2 where d > a)
+1 2 3 1
+11 22 33 11
+select a as 'x', t1.* from t1;
+x a b c
+1 1 2 3
+11 11 22 33
+select t1.*, a as 'x' from t1;
+a b c x
+1 2 3 1
+11 22 33 11
+select a as 'x', t1.*, b as 'x' from t1;
+x a b c x
+1 1 2 3 2
+11 11 22 33 22
+select (select d from t2 where d > a) as 'x', t1.* from t1;
+x a b c
+99 1 2 3
+99 11 22 33
+select t1.*, (select a from t2 where d > a) as 'x' from t1;
+a b c x
+1 2 3 1
+11 22 33 11
+select (select t2.* from t2) from t1;
+(select t2.* from t2)
+99
+99
+select a, (select t2.* from t2) from t1;
+a (select t2.* from t2)
+1 99
+11 99
+select t1.*, (select t2.* from t2) from t1;
+a b c (select t2.* from t2)
+1 2 3 99
+11 22 33 99
+insert into t3 select t1.* from t1;
+insert into t3 select t2.*, 1, 2 from t2;
+insert into t3 select t2.*, d as 'x', d as 'z' from t2;
+insert into t3 select t2.*, t2.*, 3 from t2;
+create table t4 select t1.* from t1;
+drop table t4;
+create table t4 select t2.*, 1, 2 from t2;
+drop table t4;
+create table t4 select t2.*, d as 'x', d as 'z' from t2;
+drop table t4;
+drop table t1,t2,t3;
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 004e2031fb1..db80e9d2eea 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1346,3 +1346,11 @@ CREATE TABLE t1 (a TEXT, id INT, b INT);
ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
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/archive.result b/mysql-test/r/archive.result
index c620eb97cab..aaab9d27edb 100644
--- a/mysql-test/r/archive.result
+++ b/mysql-test/r/archive.result
@@ -1,3 +1,4 @@
+CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
DROP TABLE if exists t1,t2,t3,t4,t5,t6;
SET storage_engine=ARCHIVE;
CREATE TABLE t1 (
@@ -12707,7 +12708,7 @@ DATA_LENGTH AVG_ROW_LENGTH
8700 4350
DROP TABLE t1;
SET @save_join_buffer_size= @@join_buffer_size;
-SET @@join_buffer_size= 8228;
+SET @@join_buffer_size= 8192;
CREATE TABLE t1(a CHAR(255)) ENGINE=archive;
INSERT INTO t1 VALUES('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
@@ -12717,6 +12718,16 @@ COUNT(t1.a)
729
DROP TABLE t1;
SET @@join_buffer_size= @save_join_buffer_size;
+End of 5.1 tests
+CREATE TABLE t1(id INT NOT NULL AUTO_INCREMENT, name VARCHAR(128) NOT NULL, PRIMARY KEY(id)) ENGINE=archive;
+INSERT INTO t1 VALUES(NULL,'a'),(NULL,'a');
+CREATE TABLE t2(id INT NOT NULL AUTO_INCREMENT, name VARCHAR(128) NOT NULL, PRIMARY KEY(id)) ENGINE=archive;
+INSERT INTO t2 VALUES(NULL,'b'),(NULL,'b');
+SELECT t1.id, t2.id, t1.name, t2.name FROM t1,t2 WHERE t1.id = t2.id;
+id id name name
+1 1 a b
+2 2 a b
+DROP TABLE t1,t2;
SHOW CREATE TABLE t1;
ERROR HY000: Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it!
SELECT * FROM t1;
diff --git a/mysql-test/r/archive_gis.result b/mysql-test/r/archive_gis.result
index 178c5716911..ad7bd374629 100644
--- a/mysql-test/r/archive_gis.result
+++ b/mysql-test/r/archive_gis.result
@@ -266,7 +266,7 @@ fid AsText(EndPoint(g))
107 POINT(40 10)
SELECT fid, GLength(g) FROM gis_line ORDER by fid;
fid GLength(g)
-105 24.142135623731
+105 24.14213562373095
106 40
107 30
SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
@@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
fid AsText(Centroid(g))
108 POINT(15 15)
-109 POINT(25.4166666666667 25.4166666666667)
+109 POINT(25.416666666666668 25.416666666666668)
110 POINT(20 10)
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
fid Area(g)
@@ -326,8 +326,8 @@ fid IsClosed(g)
116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
fid AsText(Centroid(g))
-117 POINT(55.5885277530424 17.426536064114)
-118 POINT(55.5885277530424 17.426536064114)
+117 POINT(55.58852775304245 17.426536064113982)
+118 POINT(55.58852775304245 17.426536064113982)
119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
fid Area(g)
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/bug46080.result b/mysql-test/r/bug46080.result
index 2173768cdad..f1abcde7766 100644
--- a/mysql-test/r/bug46080.result
+++ b/mysql-test/r/bug46080.result
@@ -8,6 +8,8 @@ CREATE TABLE t1(a CHAR(255));
INSERT INTO t1 VALUES ('a');
SET @@SESSION.sort_buffer_size=5*16*1000000;
SET @@SESSION.max_heap_table_size=5*1000000;
+Warnings:
+Warning 1292 Truncated incorrect max_heap_table_size value: '5000000'
# Must not crash.
SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
DROP TABLE t1;
diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result
index b59298727c5..600ed84c3c9 100644
--- a/mysql-test/r/cache_innodb.result
+++ b/mysql-test/r/cache_innodb.result
@@ -134,7 +134,7 @@ connection default
SHOW VARIABLES LIKE 'have_query_cache';
Variable_name Value
have_query_cache YES
-SET GLOBAL query_cache_size = 200000;
+SET GLOBAL query_cache_size = 204800;
flush status;
SET @@autocommit=1;
SET SESSION STORAGE_ENGINE = InnoDB;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index dd61396e485..3e1ea824db5 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -342,11 +342,11 @@ INSERT INTO t1 SET f1 = -1.0e+30 ;
INSERT INTO t1 SET f1 = +1.0e+30 ;
SELECT f1 AS double_val, CAST(f1 AS SIGNED INT) AS cast_val FROM t1;
double_val cast_val
--1e+30 -9223372036854775808
-1e+30 9223372036854775807
+-1e30 -9223372036854775808
+1e30 9223372036854775807
Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '-1e+30'
-Warning 1292 Truncated incorrect INTEGER value: '1e+30'
+Warning 1292 Truncated incorrect INTEGER value: '-1e30'
+Warning 1292 Truncated incorrect INTEGER value: '1e30'
DROP TABLE t1;
select isnull(date(NULL)), isnull(cast(NULL as DATE));
isnull(date(NULL)) isnull(cast(NULL as DATE))
@@ -363,7 +363,7 @@ cast('1.2' as decimal(3,2))
1.20
select 1e18 * cast('1.2' as decimal(3,2));
1e18 * cast('1.2' as decimal(3,2))
-1.2e+18
+1.2e18
select cast(cast('1.2' as decimal(3,2)) as signed);
cast(cast('1.2' as decimal(3,2)) as signed)
1
@@ -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/change_user.result b/mysql-test/r/change_user.result
index f8d5d900a80..1ed7fcbb8fa 100644
--- a/mysql-test/r/change_user.result
+++ b/mysql-test/r/change_user.result
@@ -18,7 +18,7 @@ change_user
SELECT @@session.sql_big_selects;
@@session.sql_big_selects
0
-SET @@global.max_join_size = -1;
+SET @@global.max_join_size = 18446744073709551615;
SET @@session.max_join_size = default;
change_user
SELECT @@session.sql_big_selects;
diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result
index 51c4ac3002c..cf8c0e085c9 100644
--- a/mysql-test/r/commit_1innodb.result
+++ b/mysql-test/r/commit_1innodb.result
@@ -1,3 +1,4 @@
+call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
set sql_mode=no_engine_substitution;
set storage_engine = InnoDB;
set autocommit=1;
@@ -578,11 +579,11 @@ SUCCESS
select f1();
f1()
2
-call p_verify_status_increment(0, 0, 1, 0);
+call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
commit;
-call p_verify_status_increment(0, 0, 1, 0);
+call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
# 17. Read-only statement, a function changes non-trans-table.
@@ -595,11 +596,11 @@ select f1() from t1;
f1()
2
2
-call p_verify_status_increment(1, 0, 2, 0);
+call p_verify_status_increment(2, 0, 2, 0);
SUCCESS
commit;
-call p_verify_status_increment(1, 0, 2, 0);
+call p_verify_status_increment(2, 0, 2, 0);
SUCCESS
# 18. Read-write statement: UPDATE, change 0 (transactional) rows.
@@ -627,7 +628,7 @@ SUCCESS
drop table t2;
set sql_mode=no_engine_substitution;
create temporary table t2 (a int);
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(1, 0, 0, 0);
SUCCESS
set sql_mode=default;
@@ -708,11 +709,11 @@ SUCCESS
# 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
#
drop temporary table t2;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(1, 0, 0, 0);
SUCCESS
commit;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(1, 0, 0, 0);
SUCCESS
# 26. Verify that SET AUTOCOMMIT issues an implicit commit
@@ -829,11 +830,11 @@ create table if not exists t2 (a int) select 6 union select 7;
Warnings:
Note 1050 Table 't2' already exists
# Sic: first commits the statement, and then the transaction.
-call p_verify_status_increment(4, 4, 4, 4);
+call p_verify_status_increment(2, 0, 4, 4);
SUCCESS
create table t3 select a from t2;
-call p_verify_status_increment(4, 4, 4, 4);
+call p_verify_status_increment(2, 0, 4, 4);
SUCCESS
alter table t3 add column (b int);
@@ -841,15 +842,15 @@ call p_verify_status_increment(2, 0, 2, 0);
SUCCESS
alter table t3 rename t4;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
rename table t4 to t3;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(1, 0, 1, 0);
SUCCESS
truncate table t3;
-call p_verify_status_increment(4, 4, 4, 4);
+call p_verify_status_increment(2, 0, 2, 0);
SUCCESS
create view v1 as select * from t2;
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 cfdf2565c9c..55e8e15b6a9 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -228,7 +228,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
drop table t1;
SET SESSION storage_engine="gemini";
-ERROR 42000: Unknown table engine 'gemini'
+ERROR 42000: Unknown storage engine 'gemini'
SELECT @@storage_engine;
@@storage_engine
MEMORY
@@ -389,7 +389,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MEMORY DEFAULT CHARSET=latin1
drop table t1;
SET SESSION storage_engine="gemini";
-ERROR 42000: Unknown table engine 'gemini'
+ERROR 42000: Unknown storage engine 'gemini'
SELECT @@storage_engine;
@@storage_engine
MEMORY
@@ -1919,3 +1919,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/csv.result b/mysql-test/r/csv.result
index 4b96f5a5ed0..97996b484bb 100644
--- a/mysql-test/r/csv.result
+++ b/mysql-test/r/csv.result
@@ -5407,4 +5407,60 @@ test.t1 repair status OK
select * from t1 limit 1;
a
drop table t1;
+#
+# Test for the following cases
+# 1) integers and strings enclosed in quotes
+# 2) integers and strings not enclosed in quotes
+# 3) \X characters with quotes
+# 4) \X characters outside quotes
+#
+CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
+# remove the already existing .CSV file if any
+# create the .CSV file that contains the hard-coded data used in
+# testing
+1,"integer sans quotes"
+1,string sans quotes
+1,quotes"in between" strings
+"1",Integer with quote and string with no quote
+1,"escape sequence \n \" \\ \r \a within quotes"
+1,escape sequence \n \" \\ \r \a without quotes
+# select from the table in which the data has been filled in using
+# the hard-coded .CSV file
+SELECT * FROM t1;
+c1 c2
+1 integer sans quotes
+1 string sans quotes
+1 quotes"in between" strings
+1 Integer with quote and string with no quote
+1 escape sequence
+ " \ \a within quotes
+1 escape sequence
+ " \ \a without quotes
+DROP TABLE t1;
+# Test for the case when a field begins with a quote, but does not end in a
+# quote.
+# Note: This results in an error.
+CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
+# remove the already existing .CSV file if any
+# create the .CSV file that contains the hard-coded data used in
+# testing
+1,"string only at the beginning quotes
+# select from the table in which the data has been filled in using
+# the hard-coded .CSV file
+SELECT * FROM t1;
+ERROR HY000: Table 't1' is marked as crashed and should be repaired
+DROP TABLE t1;
+# Test for the case when a field ends with a quote, but does not begin in a
+# quote.
+# Note: This results in an error.
+CREATE TABLE t1(c1 INT NOT NULL, c2 VARCHAR(50) NOT NULL) ENGINE=csv;
+# remove the already existing .CSV file if any
+# create the .CSV file that contains the hard-coded data used in
+# testing
+1,string with only ending quotes"
+# select from the table in which the data has been filled in using
+# the hard-coded .CSV file
+SELECT * FROM t1;
+ERROR HY000: Table 't1' is marked as crashed and should be repaired
+DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result
index 2efcf549608..d81534ac84e 100644
--- a/mysql-test/r/ctype_big5.result
+++ b/mysql-test/r/ctype_big5.result
@@ -277,3 +277,281 @@ hex(a)
EE00
drop table t1;
End of 5.0 tests
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=big5_chinese_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT concat(head, tail) AS code, ' ' AS a
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(8) DEFAULT NULL,
+ `a` varchar(1) CHARACTER SET big5 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+28672
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1 WHERE a<>'';
+COUNT(*)
+13973
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+A2CF A2CF A2E9   
+A2D0 A2D0 A2EA   
+A2D1 A2D1 A2EB   
+A2D2 A2D2 A2EC   
+A2D3 A2D3 A2ED   
+A2D4 A2D4 A2EE   
+A2D5 A2D5 A2EF   
+A2D6 A2D6 A2F0   
+A2D7 A2D7 A2F1   
+A2D8 A2D8 A2F2   
+A2D9 A2D9 A2F3   
+A2DA A2DA A2F4   
+A2DB A2DB A2F5   
+A2DC A2DC A2F6   
+A2DD A2DD A2F7   
+A2DE A2DE A2F8   
+A2DF A2DF A2F9   
+A2E0 A2E0 A2FA   
+A2E1 A2E1 A2FB   
+A2E2 A2E2 A2FC   
+A2E3 A2E3 A2FD   
+A2E4 A2E4 A2FE   
+A2E5 A2E5 A340   
+A2E6 A2E6 A341   
+A2E7 A2E7 A342   
+A2E8 A2E8 A343   
+A2E9 A2CF A2E9   
+A2EA A2D0 A2EA   
+A2EB A2D1 A2EB   
+A2EC A2D2 A2EC   
+A2ED A2D3 A2ED   
+A2EE A2D4 A2EE   
+A2EF A2D5 A2EF   
+A2F0 A2D6 A2F0   
+A2F1 A2D7 A2F1   
+A2F2 A2D8 A2F2   
+A2F3 A2D9 A2F3   
+A2F4 A2DA A2F4   
+A2F5 A2DB A2F5   
+A2F6 A2DC A2F6   
+A2F7 A2DD A2F7   
+A2F8 A2DE A2F8   
+A2F9 A2DF A2F9   
+A2FA A2E0 A2FA   
+A2FB A2E1 A2FB   
+A2FC A2E2 A2FC   
+A2FD A2E3 A2FD   
+A2FE A2E4 A2FE   
+A340 A2E5 A340   
+A341 A2E6 A341   
+A342 A2E7 A342   
+A343 A2E8 A343   
+A344 A344 A35C Α Α α
+A345 A345 A35D Β Β β
+A346 A346 A35E Γ Γ γ
+A347 A347 A35F Δ Δ ή
+A348 A348 A360 Ε Ε ε
+A349 A349 A361 Ζ Ζ ζ
+A34A A34A A362 Η Η η
+A34B A34B A363 Θ Θ Ξ
+A34C A34C A364 Ι Ι ι
+A34D A34D A365 Κ Κ κ
+A34E A34E A366 Λ Λ λ
+A34F A34F A367 Μ Μ ÎŒ
+A350 A350 A368 Ν Ν Μ
+A351 A351 A369 Ξ Ξ Ο
+A352 A352 A36A Ο Ο ο
+A353 A353 A36B Π Π π
+A354 A354 A36C Ρ Ρ ρ
+A355 A355 A36D Σ Σ σ
+A356 A356 A36E ΀ ΀ τ
+A357 A357 A36F Υ Υ υ
+A358 A358 A370 Ί Ί φ
+A359 A359 A371 Χ Χ χ
+A35A A35A A372 Κ Κ ψ
+A35B A35B A373 Ω Ω ω
+A35C A344 A35C α Α α
+A35D A345 A35D β Β β
+A35E A346 A35E γ Γ γ
+A35F A347 A35F ή Δ ή
+A360 A348 A360 ε Ε ε
+A361 A349 A361 ζ Ζ ζ
+A362 A34A A362 η Η η
+A363 A34B A363 Ξ Θ Ξ
+A364 A34C A364 ι Ι ι
+A365 A34D A365 κ Κ κ
+A366 A34E A366 λ Λ λ
+A367 A34F A367 ÎŒ Μ ÎŒ
+A368 A350 A368 Μ Ν Μ
+A369 A351 A369 Ο Ξ Ο
+A36A A352 A36A ο Ο ο
+A36B A353 A36B π Π π
+A36C A354 A36C ρ Ρ ρ
+A36D A355 A36D σ Σ σ
+A36E A356 A36E τ ΀ τ
+A36F A357 A36F υ Υ υ
+A370 A358 A370 φ Ί φ
+A371 A359 A371 χ Χ χ
+A372 A35A A372 ψ Κ ψ
+A373 A35B A373 ω Ω ω
+C7B1 C7B1 C7CC Д Д ÐŽ
+C7B2 C7B2 C7CD Е Е е
+C7B3 C7B3 C7CE Ё Ё ё
+C7B4 C7B4 C7CF Ж Ж ж
+C7B5 C7B5 C7D0 З З з
+C7B6 C7B6 C7D1 И И О
+C7B7 C7B7 C7D2 Й Й й
+C7B8 C7B8 C7D3 К К к
+C7B9 C7B9 C7D4 Л Л л
+C7BA C7BA C7D5 М М ÐŒ
+C7BB C7BB C7DC У У у
+C7BC C7BC C7DD Ѐ Ѐ ф
+C7BD C7BD C7DE Х Х х
+C7BE C7BE C7DF Њ Њ ц
+C7BF C7BF C7E0 Ч Ч ч
+C7C0 C7C0 C7E1 К К ш
+C7C1 C7C1 C7E2 Щ Щ щ
+C7C2 C7C2 C7E3 Ъ Ъ ъ
+C7C3 C7C3 C7E4 Ы Ы ы
+C7C4 C7C4 C7E5 Ь Ь ь
+C7C5 C7C5 C7E6 Э Э э
+C7C6 C7C6 C7E7 Ю Ю ю
+C7C7 C7C7 C7E8 Я Я я
+C7CC C7B1 C7CC ÐŽ Д ÐŽ
+C7CD C7B2 C7CD е Е е
+C7CE C7B3 C7CE ё Ё ё
+C7CF C7B4 C7CF ж Ж ж
+C7D0 C7B5 C7D0 з З з
+C7D1 C7B6 C7D1 О И О
+C7D2 C7B7 C7D2 й Й й
+C7D3 C7B8 C7D3 к К к
+C7D4 C7B9 C7D4 л Л л
+C7D5 C7BA C7D5 ÐŒ М ÐŒ
+C7DC C7BB C7DC у У у
+C7DD C7BC C7DD ф Ѐ ф
+C7DE C7BD C7DE х Х х
+C7DF C7BE C7DF ц Њ ц
+C7E0 C7BF C7E0 ч Ч ч
+C7E1 C7C0 C7E1 ш К ш
+C7E2 C7C1 C7E2 щ Щ щ
+C7E3 C7C2 C7E3 ъ Ъ ъ
+C7E4 C7C3 C7E4 ы Ы ы
+C7E5 C7C4 C7E5 ь Ь ь
+C7E6 C7C5 C7E6 э Э э
+C7E7 C7C6 C7E7 ю Ю ю
+C7E8 C7C7 C7E8 я Я я
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+A2B9 Ⅰ
+A2BA Ⅱ
+A2BB Ⅲ
+A2BC Ⅳ
+A2BD â…€
+A2BE Ⅵ
+A2BF Ⅹ
+A2C0 Ⅷ
+A2C1 ⅹ
+A2C2 Ⅹ
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+C7C8 а
+C7C9 б
+C7CA в
+C7CB г
+C7D6 М
+C7D7 П
+C7D8 п
+C7D9 р
+C7DA с
+C7DB т
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
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_cp1251.result b/mysql-test/r/ctype_cp1251.result
index 47797af3cbe..bf0bc07c50e 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -70,3 +70,14 @@ we_ivo NULL
we_martin NULL
we_toshko NULL
drop table t1;
+CREATE TABLE t1 (
+e1 enum('ÿáúëêà'),
+e2 enum('ìëÿêî')
+) ENGINE=MYISAM character set cp1251;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `e1` enum('ÿáúëêà') DEFAULT NULL,
+ `e2` enum('ìëÿêî') DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=cp1251
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result
index 044885d1ea7..47ff51a9c44 100644
--- a/mysql-test/r/ctype_cp932_binlog_stm.result
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result
@@ -9,11 +9,14 @@ EXECUTE stmt1 USING @var1;
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob)
+master-bin.000001 # Query # # BEGIN
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(0x8300)
+master-bin.000001 # Query # # COMMIT
SELECT HEX(f1) FROM t1;
HEX(f1)
8300
DROP table t1;
+call mtr.add_suppression('Error in Log_event::read_log_event()');
CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1,
s2 CHAR(50) CHARACTER SET cp932,
d DECIMAL(10,2))|
@@ -29,22 +32,27 @@ HEX(s1) HEX(s2) d
466F6F2773206120426172 ED40ED41ED42 47.93
DROP PROCEDURE bug18293|
DROP TABLE t4|
-SHOW BINLOG EVENTS FROM 370|
+SHOW BINLOG EVENTS FROM 514|
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 514 Query 1 581 BEGIN
+master-bin.000001 581 Query 1 788 use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Error in Log_event::read_log_event()' COLLATE 'latin1_swedish_ci'))
+master-bin.000001 788 Query 1 856 COMMIT
+master-bin.000001 856 Query 1 1019 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 1019 Query 1 1265 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 1265 Query 1 1333 BEGIN
+master-bin.000001 1333 Query 1 1597 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 1597 Query 1 1666 COMMIT
+master-bin.000001 1666 Query 1 1752 use `test`; DROP PROCEDURE bug18293
+master-bin.000001 1752 Query 1 1828 use `test`; DROP TABLE t4
End of 5.0 tests
-SHOW BINLOG EVENTS FROM 365;
+SHOW BINLOG EVENTS FROM 490;
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;
@@ -55,3 +63,331 @@ hex(a) hex(lower(a)) hex(upper(a))
8372835E 8372835E 8372835E
DROP TABLE t1;
End of 5.1 tests
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=cp932_japanese_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT concat(head, tail) AS code, ' ' AS a
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN 'A1' AND 'DF')
+AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+INSERT t1 (code) SELECT head FROM head
+WHERE (head BETWEEN 'A1' AND 'DF')
+ORDER BY head;
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(8) DEFAULT NULL,
+ `a` varchar(1) CHARACTER SET cp932 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+14623
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=1;
+COUNT(*)
+63
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
+COUNT(*)
+11280
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1
+WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a))
+ORDER BY code;
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+8260 8260 8281   
+8261 8261 8282   
+8262 8262 8283   
+8263 8263 8284   
+8264 8264 8285   
+8265 8265 8286   
+8266 8266 8287   
+8267 8267 8288   
+8268 8268 8289   
+8269 8269 828A   
+826A 826A 828B   
+826B 826B 828C   
+826C 826C 828D   
+826D 826D 828E   
+826E 826E 828F   
+826F 826F 8290   
+8270 8270 8291   
+8271 8271 8292   
+8272 8272 8293   
+8273 8273 8294   
+8274 8274 8295   
+8275 8275 8296   
+8276 8276 8297   
+8277 8277 8298   
+8278 8278 8299   
+8279 8279 829A   
+8281 8260 8281   
+8282 8261 8282   
+8283 8262 8283   
+8284 8263 8284   
+8285 8264 8285   
+8286 8265 8286   
+8287 8266 8287   
+8288 8267 8288   
+8289 8268 8289   
+828A 8269 828A   
+828B 826A 828B   
+828C 826B 828C   
+828D 826C 828D   
+828E 826D 828E   
+828F 826E 828F   
+8290 826F 8290   
+8291 8270 8291   
+8292 8271 8292   
+8293 8272 8293   
+8294 8273 8294   
+8295 8274 8295   
+8296 8275 8296   
+8297 8276 8297   
+8298 8277 8298   
+8299 8278 8299   
+829A 8279 829A   
+839F 839F 83BF Α Α α
+83A0 83A0 83C0 Β Β β
+83A1 83A1 83C1 Γ Γ γ
+83A2 83A2 83C2 Δ Δ ή
+83A3 83A3 83C3 Ε Ε ε
+83A4 83A4 83C4 Ζ Ζ ζ
+83A5 83A5 83C5 Η Η η
+83A6 83A6 83C6 Θ Θ Ξ
+83A7 83A7 83C7 Ι Ι ι
+83A8 83A8 83C8 Κ Κ κ
+83A9 83A9 83C9 Λ Λ λ
+83AA 83AA 83CA Μ Μ ÎŒ
+83AB 83AB 83CB Ν Ν Μ
+83AC 83AC 83CC Ξ Ξ Ο
+83AD 83AD 83CD Ο Ο ο
+83AE 83AE 83CE Π Π π
+83AF 83AF 83CF Ρ Ρ ρ
+83B0 83B0 83D0 Σ Σ σ
+83B1 83B1 83D1 ΀ ΀ τ
+83B2 83B2 83D2 Υ Υ υ
+83B3 83B3 83D3 Ί Ί φ
+83B4 83B4 83D4 Χ Χ χ
+83B5 83B5 83D5 Κ Κ ψ
+83B6 83B6 83D6 Ω Ω ω
+83BF 839F 83BF α Α α
+83C0 83A0 83C0 β Β β
+83C1 83A1 83C1 γ Γ γ
+83C2 83A2 83C2 ή Δ ή
+83C3 83A3 83C3 ε Ε ε
+83C4 83A4 83C4 ζ Ζ ζ
+83C5 83A5 83C5 η Η η
+83C6 83A6 83C6 Ξ Θ Ξ
+83C7 83A7 83C7 ι Ι ι
+83C8 83A8 83C8 κ Κ κ
+83C9 83A9 83C9 λ Λ λ
+83CA 83AA 83CA ÎŒ Μ ÎŒ
+83CB 83AB 83CB Μ Ν Μ
+83CC 83AC 83CC Ο Ξ Ο
+83CD 83AD 83CD ο Ο ο
+83CE 83AE 83CE π Π π
+83CF 83AF 83CF ρ Ρ ρ
+83D0 83B0 83D0 σ Σ σ
+83D1 83B1 83D1 τ ΀ τ
+83D2 83B2 83D2 υ Υ υ
+83D3 83B3 83D3 φ Ί φ
+83D4 83B4 83D4 χ Χ χ
+83D5 83B5 83D5 ψ Κ ψ
+83D6 83B6 83D6 ω Ω ω
+8440 8440 8470 А А а
+8441 8441 8471 Б Б б
+8442 8442 8472 В В в
+8443 8443 8473 Г Г г
+8444 8444 8474 Д Д ÐŽ
+8445 8445 8475 Е Е е
+8446 8446 8476 Ё Ё ё
+8447 8447 8477 Ж Ж ж
+8448 8448 8478 З З з
+8449 8449 8479 И И О
+844A 844A 847A Й Й й
+844B 844B 847B К К к
+844C 844C 847C Л Л л
+844D 844D 847D М М ÐŒ
+844E 844E 847E Н Н М
+844F 844F 8480 О О П
+8450 8450 8481 П П п
+8451 8451 8482 Р Р р
+8452 8452 8483 С С с
+8453 8453 8484 Т Т т
+8454 8454 8485 У У у
+8455 8455 8486 Ѐ Ѐ ф
+8456 8456 8487 Х Х х
+8457 8457 8488 Њ Њ ц
+8458 8458 8489 Ч Ч ч
+8459 8459 848A К К ш
+845A 845A 848B Щ Щ щ
+845B 845B 848C Ъ Ъ ъ
+845C 845C 848D Ы Ы ы
+845D 845D 848E Ь Ь ь
+845E 845E 848F Э Э э
+845F 845F 8490 Ю Ю ю
+8460 8460 8491 Я Я я
+8470 8440 8470 а А а
+8471 8441 8471 б Б б
+8472 8442 8472 в В в
+8473 8443 8473 г Г г
+8474 8444 8474 ÐŽ Д ÐŽ
+8475 8445 8475 е Е е
+8476 8446 8476 ё Ё ё
+8477 8447 8477 ж Ж ж
+8478 8448 8478 з З з
+8479 8449 8479 О И О
+847A 844A 847A й Й й
+847B 844B 847B к К к
+847C 844C 847C л Л л
+847D 844D 847D ÐŒ М ÐŒ
+847E 844E 847E М Н М
+8480 844F 8480 П О П
+8481 8450 8481 п П п
+8482 8451 8482 р Р р
+8483 8452 8483 с С с
+8484 8453 8484 т Т т
+8485 8454 8485 у У у
+8486 8455 8486 ф Ѐ ф
+8487 8456 8487 х Х х
+8488 8457 8488 ц Њ ц
+8489 8458 8489 ч Ч ч
+848A 8459 848A ш К ш
+848B 845A 848B щ Щ щ
+848C 845B 848C ъ Ъ ъ
+848D 845C 848D ы Ы ы
+848E 845D 848E ь Ь ь
+848F 845E 848F э Э э
+8490 845F 8490 ю Ю ю
+8491 8460 8491 я Я я
+8754 8754 EEEF Ⅰ Ⅰ ⅰ
+8755 8755 EEF0 Ⅱ Ⅱ ⅱ
+8756 8756 EEF1 Ⅲ Ⅲ ⅲ
+8757 8757 EEF2 Ⅳ Ⅳ ⅳ
+8758 8758 EEF3 â…€ â…€ Ⅾ
+8759 8759 EEF4 Ⅵ Ⅵ ⅵ
+875A 875A EEF5 Ⅹ Ⅹ ⅶ
+875B 875B EEF6 Ⅷ Ⅷ ⅷ
+875C 875C EEF7 ⅹ ⅹ ⅾ
+875D 875D EEF8 Ⅹ Ⅹ ⅹ
+EEEF 8754 EEEF ⅰ Ⅰ ⅰ
+EEF0 8755 EEF0 ⅱ Ⅱ ⅱ
+EEF1 8756 EEF1 ⅲ Ⅲ ⅲ
+EEF2 8757 EEF2 ⅳ Ⅳ ⅳ
+EEF3 8758 EEF3 Ⅾ â…€ Ⅾ
+EEF4 8759 EEF4 ⅵ Ⅵ ⅵ
+EEF5 875A EEF5 ⅶ Ⅹ ⅶ
+EEF6 875B EEF6 ⅷ Ⅷ ⅷ
+EEF7 875C EEF7 ⅾ ⅹ ⅾ
+EEF8 875D EEF8 ⅹ Ⅹ ⅹ
+FA40 FA4A FA40 ⅰ Ⅰ ⅰ
+FA41 FA4B FA41 ⅱ Ⅱ ⅱ
+FA42 FA4C FA42 ⅲ Ⅲ ⅲ
+FA43 FA4D FA43 ⅳ Ⅳ ⅳ
+FA44 FA4E FA44 Ⅾ â…€ Ⅾ
+FA45 FA4F FA45 ⅵ Ⅵ ⅵ
+FA46 FA50 FA46 ⅶ Ⅹ ⅶ
+FA47 FA51 FA47 ⅷ Ⅷ ⅷ
+FA48 FA52 FA48 ⅾ ⅹ ⅾ
+FA49 FA53 FA49 ⅹ Ⅹ ⅹ
+FA4A FA4A FA40 Ⅰ Ⅰ ⅰ
+FA4B FA4B FA41 Ⅱ Ⅱ ⅱ
+FA4C FA4C FA42 Ⅲ Ⅲ ⅲ
+FA4D FA4D FA43 Ⅳ Ⅳ ⅳ
+FA4E FA4E FA44 â…€ â…€ Ⅾ
+FA4F FA4F FA45 Ⅵ Ⅵ ⅵ
+FA50 FA50 FA46 Ⅹ Ⅹ ⅶ
+FA51 FA51 FA47 Ⅷ Ⅷ ⅷ
+FA52 FA52 FA48 ⅹ ⅹ ⅾ
+FA53 FA53 FA49 Ⅹ Ⅹ ⅹ
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+81F0 Å
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
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_eucjpms.result b/mysql-test/r/ctype_eucjpms.result
index 21aa38b7fe6..c8ece9a28cd 100755
--- a/mysql-test/r/ctype_eucjpms.result
+++ b/mysql-test/r/ctype_eucjpms.result
@@ -9859,3 +9859,567 @@ hex(convert(_eucjpms 0xA5FE41 using ucs2))
select hex(convert(_eucjpms 0x8FABF841 using ucs2));
hex(convert(_eucjpms 0x8FABF841 using ucs2))
003F0041
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=eucjpms_japanese_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT 'XXXXXX' AS code, ' ' AS a LIMIT 0;
+INSERT INTO t1 (code) SELECT concat('8E', head) FROM head
+WHERE (head BETWEEN 'A1' AND 'DF') ORDER BY head;
+INSERT INTO t1 (code) SELECT concat(head, tail)
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN '8E' AND '8F')
+AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+INSERT INTO t1 (code) SELECT concat('8F', head, tail)
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(6) CHARACTER SET eucjpms NOT NULL DEFAULT '',
+ `a` varchar(1) CHARACTER SET eucjpms NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+56959
+SELECT COUNT(*) FROM t1 WHERE a<>'';
+COUNT(*)
+17735
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
+COUNT(*)
+8899
+SELECT * FROM t1 WHERE CHAR_LENGTH(a)=2;
+code a
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=3;
+COUNT(*)
+8836
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a)) ORDER BY code;
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+8FA6E1 8FA6E1 8FA6F1 Ά Ά ά
+8FA6E2 8FA6E2 8FA6F2 Έ Έ έ
+8FA6E3 8FA6E3 8FA6F3 Ή Ή ή
+8FA6E4 8FA6E4 8FA6F4 Ί Ί ί
+8FA6E5 8FA6E5 8FA6F5 Ϊ Ϊ ϊ
+8FA6E7 8FA6E7 8FA6F7 Ό Ό ό
+8FA6E9 8FA6E9 8FA6F9 Ύ Ύ ύ
+8FA6EA 8FA6EA 8FA6FA Ϋ Ϋ ϋ
+8FA6EC 8FA6EC 8FA6FC Ώ Ώ ώ
+8FA6F1 8FA6E1 8FA6F1 ά Ά ά
+8FA6F2 8FA6E2 8FA6F2 έ Έ έ
+8FA6F3 8FA6E3 8FA6F3 ή Ή ή
+8FA6F4 8FA6E4 8FA6F4 ί Ί ί
+8FA6F5 8FA6E5 8FA6F5 ϊ Ϊ ϊ
+8FA6F7 8FA6E7 8FA6F7 ό Ό ό
+8FA6F8 A6B2 8FA6F8 ς Σ ς
+8FA6F9 8FA6E9 8FA6F9 ύ Ύ ύ
+8FA6FA 8FA6EA 8FA6FA ϋ Ϋ ϋ
+8FA6FC 8FA6EC 8FA6FC ώ Ώ ώ
+8FA7C2 8FA7C2 8FA7F2 Ђ Ђ ђ
+8FA7C3 8FA7C3 8FA7F3 Ѓ Ѓ ѓ
+8FA7C4 8FA7C4 8FA7F4 Є Є є
+8FA7C5 8FA7C5 8FA7F5 Ѕ Ѕ ѕ
+8FA7C6 8FA7C6 8FA7F6 І І і
+8FA7C7 8FA7C7 8FA7F7 Ї Ї ї
+8FA7C8 8FA7C8 8FA7F8 Ј Ј ј
+8FA7C9 8FA7C9 8FA7F9 Љ Љ љ
+8FA7CA 8FA7CA 8FA7FA Њ Њ њ
+8FA7CB 8FA7CB 8FA7FB Ћ Ћ ћ
+8FA7CC 8FA7CC 8FA7FC Ќ Ќ ќ
+8FA7CD 8FA7CD 8FA7FD Ў Ў ў
+8FA7CE 8FA7CE 8FA7FE Џ Џ џ
+8FA7F2 8FA7C2 8FA7F2 ђ Ђ ђ
+8FA7F3 8FA7C3 8FA7F3 ѓ Ѓ ѓ
+8FA7F4 8FA7C4 8FA7F4 є Є є
+8FA7F5 8FA7C5 8FA7F5 ѕ Ѕ ѕ
+8FA7F6 8FA7C6 8FA7F6 і І і
+8FA7F7 8FA7C7 8FA7F7 ї Ї ї
+8FA7F8 8FA7C8 8FA7F8 ј Ј ј
+8FA7F9 8FA7C9 8FA7F9 љ Љ љ
+8FA7FA 8FA7CA 8FA7FA њ Њ њ
+8FA7FB 8FA7CB 8FA7FB ћ Ћ ћ
+8FA7FC 8FA7CC 8FA7FC ќ Ќ ќ
+8FA7FD 8FA7CD 8FA7FD ў Ў ў
+8FA7FE 8FA7CE 8FA7FE џ Џ џ
+8FA9A1 8FA9A1 8FA9C1 Æ Æ Ê
+8FA9A2 8FA9A2 8FA9C2 Đ Đ đ
+8FA9A4 8FA9A4 8FA9C4 Ċ Ċ ħ
+8FA9A6 8FA9A6 8FA9C6 IJ IJ ij
+8FA9A8 8FA9A8 8FA9C8 Ł Ł ł
+8FA9A9 8FA9A9 8FA9C9 Ŀ Ŀ ŀ
+8FA9AB 8FA9AB 8FA9CB Ŋ Ŋ ŋ
+8FA9AC 8FA9AC 8FA9CC Ø Ø Þ
+8FA9AD 8FA9AD 8FA9CD Œ Œ œ
+8FA9AF 8FA9AF 8FA9CF Ŋ Ŋ ŧ
+8FA9B0 8FA9B0 8FA9D0 Þ Þ ß
+8FA9C1 8FA9A1 8FA9C1 Ê Æ Ê
+8FA9C2 8FA9A2 8FA9C2 đ Đ đ
+8FA9C4 8FA9A4 8FA9C4 ħ Ċ ħ
+8FA9C5 49 8FA9C5 ı I ı
+8FA9C6 8FA9A6 8FA9C6 ij IJ ij
+8FA9C8 8FA9A8 8FA9C8 ł Ł ł
+8FA9C9 8FA9A9 8FA9C9 ŀ Ŀ ŀ
+8FA9CB 8FA9AB 8FA9CB ŋ Ŋ ŋ
+8FA9CC 8FA9AC 8FA9CC Þ Ø Þ
+8FA9CD 8FA9AD 8FA9CD œ Œ œ
+8FA9CF 8FA9AF 8FA9CF ŧ Ŋ ŧ
+8FA9D0 8FA9B0 8FA9D0 ß Þ ß
+8FAAA1 8FAAA1 8FABA1 Á Á á
+8FAAA2 8FAAA2 8FABA2 À À à
+8FAAA3 8FAAA3 8FABA3 Ä Ä À
+8FAAA4 8FAAA4 8FABA4 Â Â â
+8FAAA5 8FAAA5 8FABA5 Ă Ă ă
+8FAAA6 8FAAA6 8FABA6 Ǎ Ǎ ǎ
+8FAAA7 8FAAA7 8FABA7 Ā Ā ā
+8FAAA8 8FAAA8 8FABA8 Ą Ą ą
+8FAAA9 8FAAA9 8FABA9 Å Å å
+8FAAAA 8FAAAA 8FABAA Ã Ã ã
+8FAAAB 8FAAAB 8FABAB Ć Ć ć
+8FAAAC 8FAAAC 8FABAC Ĉ Ĉ ĉ
+8FAAAD 8FAAAD 8FABAD Č Č č
+8FAAAE 8FAAAE 8FABAE Ç Ç ç
+8FAAAF 8FAAAF 8FABAF Ċ Ċ ċ
+8FAAB0 8FAAB0 8FABB0 Ď Ď ď
+8FAAB1 8FAAB1 8FABB1 É É é
+8FAAB2 8FAAB2 8FABB2 È È Ú
+8FAAB3 8FAAB3 8FABB3 Ë Ë ë
+8FAAB4 8FAAB4 8FABB4 Ê Ê ê
+8FAAB5 8FAAB5 8FABB5 Ě Ě ě
+8FAAB6 8FAAB6 8FABB6 Ė Ė ė
+8FAAB7 8FAAB7 8FABB7 Ē Ē ē
+8FAAB8 8FAAB8 8FABB8 Ę Ę ę
+8FAABA 8FAABA 8FABBA Ĝ Ĝ ĝ
+8FAABB 8FAABB 8FABBB Ğ Ğ ğ
+8FAABD 8FAABD 8FABBD Ä  Ä  Ä¡
+8FAABE 8FAABE 8FABBE Ā Ā ĥ
+8FAABF 8FAABF 8FABBF Í Í í
+8FAAC0 8FAAC0 8FABC0 Ì Ì ì
+8FAAC1 8FAAC1 8FABC1 Ï Ï ï
+8FAAC2 8FAAC2 8FABC2 Î Î î
+8FAAC3 8FAAC3 8FABC3 Ǐ Ǐ ǐ
+8FAAC4 8FAAC4 69 İ İ i
+8FAAC5 8FAAC5 8FABC5 Ī Ī ī
+8FAAC6 8FAAC6 8FABC6 Į Į į
+8FAAC7 8FAAC7 8FABC7 Äš Äš Ä©
+8FAAC8 8FAAC8 8FABC8 Ď Ď ĵ
+8FAAC9 8FAAC9 8FABC9 Ķ Ķ ķ
+8FAACA 8FAACA 8FABCA Ĺ Ĺ ĺ
+8FAACB 8FAACB 8FABCB Ĝ Ĝ ğ
+8FAACC 8FAACC 8FABCC Ļ Ļ Č
+8FAACD 8FAACD 8FABCD Ń Ń ń
+8FAACE 8FAACE 8FABCE Ň Ň ň
+8FAACF 8FAACF 8FABCF Ņ Ņ ņ
+8FAAD0 8FAAD0 8FABD0 Ñ Ñ ñ
+8FAAD1 8FAAD1 8FABD1 Ó Ó ó
+8FAAD2 8FAAD2 8FABD2 Ò Ò ò
+8FAAD3 8FAAD3 8FABD3 Ö Ö ö
+8FAAD4 8FAAD4 8FABD4 Ô Ô ÃŽ
+8FAAD5 8FAAD5 8FABD5 Ǒ Ǒ ǒ
+8FAAD6 8FAAD6 8FABD6 Ő Ő ő
+8FAAD7 8FAAD7 8FABD7 Ō Ō ō
+8FAAD8 8FAAD8 8FABD8 Õ Õ õ
+8FAAD9 8FAAD9 8FABD9 Ŕ Ŕ ŕ
+8FAADA 8FAADA 8FABDA Ř Ř ř
+8FAADB 8FAADB 8FABDB Ŗ Ŗ ŗ
+8FAADC 8FAADC 8FABDC Ś Ś ś
+8FAADD 8FAADD 8FABDD Ŝ Ŝ ŝ
+8FAADE 8FAADE 8FABDE Å  Å  Å¡
+8FAADF 8FAADF 8FABDF Ş Ş ş
+8FAAE0 8FAAE0 8FABE0 ŀ ŀ ť
+8FAAE1 8FAAE1 8FABE1 Ţ Ţ ţ
+8FAAE2 8FAAE2 8FABE2 Ú Ú ú
+8FAAE3 8FAAE3 8FABE3 Ù Ù ù
+8FAAE4 8FAAE4 8FABE4 Ü Ü ÃŒ
+8FAAE5 8FAAE5 8FABE5 Û Û û
+8FAAE6 8FAAE6 8FABE6 Ŭ Ŭ ŭ
+8FAAE7 8FAAE7 8FABE7 Ǔ Ǔ ǔ
+8FAAE8 8FAAE8 8FABE8 Ű Ű ű
+8FAAE9 8FAAE9 8FABE9 Ū Ū ū
+8FAAEA 8FAAEA 8FABEA Ų Ų ų
+8FAAEB 8FAAEB 8FABEB Ů Ů ů
+8FAAEC 8FAAEC 8FABEC Åš Åš Å©
+8FAAED 8FAAED 8FABED Ǘ Ǘ ǘ
+8FAAEE 8FAAEE 8FABEE Ǜ Ǜ ǜ
+8FAAEF 8FAAEF 8FABEF Ǚ Ǚ ǚ
+8FAAF0 8FAAF0 8FABF0 Ǖ Ǖ ǖ
+8FAAF1 8FAAF1 8FABF1 Ŏ Ŏ ŵ
+8FAAF2 8FAAF2 8FABF2 Ý Ý Ü
+8FAAF3 8FAAF3 8FABF3 Ş Ş ÿ
+8FAAF4 8FAAF4 8FABF4 Ŷ Ŷ ŷ
+8FAAF5 8FAAF5 8FABF5 Ź Ź ź
+8FAAF6 8FAAF6 8FABF6 Ŝ Ŝ ş
+8FAAF7 8FAAF7 8FABF7 Ż Ż Ō
+8FABA1 8FAAA1 8FABA1 á Á á
+8FABA2 8FAAA2 8FABA2 à À à
+8FABA3 8FAAA3 8FABA3 À Ä À
+8FABA4 8FAAA4 8FABA4 â Â â
+8FABA5 8FAAA5 8FABA5 ă Ă ă
+8FABA6 8FAAA6 8FABA6 ǎ Ǎ ǎ
+8FABA7 8FAAA7 8FABA7 ā Ā ā
+8FABA8 8FAAA8 8FABA8 ą Ą ą
+8FABA9 8FAAA9 8FABA9 å Å å
+8FABAA 8FAAAA 8FABAA ã Ã ã
+8FABAB 8FAAAB 8FABAB ć Ć ć
+8FABAC 8FAAAC 8FABAC ĉ Ĉ ĉ
+8FABAD 8FAAAD 8FABAD č Č č
+8FABAE 8FAAAE 8FABAE ç Ç ç
+8FABAF 8FAAAF 8FABAF ċ Ċ ċ
+8FABB0 8FAAB0 8FABB0 ď Ď ď
+8FABB1 8FAAB1 8FABB1 é É é
+8FABB2 8FAAB2 8FABB2 Ú È Ú
+8FABB3 8FAAB3 8FABB3 ë Ë ë
+8FABB4 8FAAB4 8FABB4 ê Ê ê
+8FABB5 8FAAB5 8FABB5 ě Ě ě
+8FABB6 8FAAB6 8FABB6 ė Ė ė
+8FABB7 8FAAB7 8FABB7 ē Ē ē
+8FABB8 8FAAB8 8FABB8 ę Ę ę
+8FABBA 8FAABA 8FABBA ĝ Ĝ ĝ
+8FABBB 8FAABB 8FABBB ğ Ğ ğ
+8FABBD 8FAABD 8FABBD Ä¡ Ä  Ä¡
+8FABBE 8FAABE 8FABBE ĥ Ā ĥ
+8FABBF 8FAABF 8FABBF í Í í
+8FABC0 8FAAC0 8FABC0 ì Ì ì
+8FABC1 8FAAC1 8FABC1 ï Ï ï
+8FABC2 8FAAC2 8FABC2 î Î î
+8FABC3 8FAAC3 8FABC3 ǐ Ǐ ǐ
+8FABC5 8FAAC5 8FABC5 ī Ī ī
+8FABC6 8FAAC6 8FABC6 į Į į
+8FABC7 8FAAC7 8FABC7 Ä© Äš Ä©
+8FABC8 8FAAC8 8FABC8 ĵ Ď ĵ
+8FABC9 8FAAC9 8FABC9 ķ Ķ ķ
+8FABCA 8FAACA 8FABCA ĺ Ĺ ĺ
+8FABCB 8FAACB 8FABCB ğ Ĝ ğ
+8FABCC 8FAACC 8FABCC Č Ļ Č
+8FABCD 8FAACD 8FABCD ń Ń ń
+8FABCE 8FAACE 8FABCE ň Ň ň
+8FABCF 8FAACF 8FABCF ņ Ņ ņ
+8FABD0 8FAAD0 8FABD0 ñ Ñ ñ
+8FABD1 8FAAD1 8FABD1 ó Ó ó
+8FABD2 8FAAD2 8FABD2 ò Ò ò
+8FABD3 8FAAD3 8FABD3 ö Ö ö
+8FABD4 8FAAD4 8FABD4 ÃŽ Ô ÃŽ
+8FABD5 8FAAD5 8FABD5 ǒ Ǒ ǒ
+8FABD6 8FAAD6 8FABD6 ő Ő ő
+8FABD7 8FAAD7 8FABD7 ō Ō ō
+8FABD8 8FAAD8 8FABD8 õ Õ õ
+8FABD9 8FAAD9 8FABD9 ŕ Ŕ ŕ
+8FABDA 8FAADA 8FABDA ř Ř ř
+8FABDB 8FAADB 8FABDB ŗ Ŗ ŗ
+8FABDC 8FAADC 8FABDC ś Ś ś
+8FABDD 8FAADD 8FABDD ŝ Ŝ ŝ
+8FABDE 8FAADE 8FABDE Å¡ Å  Å¡
+8FABDF 8FAADF 8FABDF ş Ş ş
+8FABE0 8FAAE0 8FABE0 ť ŀ ť
+8FABE1 8FAAE1 8FABE1 ţ Ţ ţ
+8FABE2 8FAAE2 8FABE2 ú Ú ú
+8FABE3 8FAAE3 8FABE3 ù Ù ù
+8FABE4 8FAAE4 8FABE4 ÃŒ Ü ÃŒ
+8FABE5 8FAAE5 8FABE5 û Û û
+8FABE6 8FAAE6 8FABE6 ŭ Ŭ ŭ
+8FABE7 8FAAE7 8FABE7 ǔ Ǔ ǔ
+8FABE8 8FAAE8 8FABE8 ű Ű ű
+8FABE9 8FAAE9 8FABE9 ū Ū ū
+8FABEA 8FAAEA 8FABEA ų Ų ų
+8FABEB 8FAAEB 8FABEB ů Ů ů
+8FABEC 8FAAEC 8FABEC Å© Åš Å©
+8FABED 8FAAED 8FABED ǘ Ǘ ǘ
+8FABEE 8FAAEE 8FABEE ǜ Ǜ ǜ
+8FABEF 8FAAEF 8FABEF ǚ Ǚ ǚ
+8FABF0 8FAAF0 8FABF0 ǖ Ǖ ǖ
+8FABF1 8FAAF1 8FABF1 ŵ Ŏ ŵ
+8FABF2 8FAAF2 8FABF2 Ü Ý Ü
+8FABF3 8FAAF3 8FABF3 ÿ Ş ÿ
+8FABF4 8FAAF4 8FABF4 ŷ Ŷ ŷ
+8FABF5 8FAAF5 8FABF5 ź Ź ź
+8FABF6 8FAAF6 8FABF6 ş Ŝ ş
+8FABF7 8FAAF7 8FABF7 Ō Ż Ō
+8FF3F3 8FF3FD 8FF3F3 ⅰ Ⅰ ⅰ
+8FF3F4 8FF3FE 8FF3F4 ⅱ Ⅱ ⅱ
+8FF3F5 8FF4A1 8FF3F5 ⅲ Ⅲ ⅲ
+8FF3F6 8FF4A2 8FF3F6 ⅳ Ⅳ ⅳ
+8FF3F7 8FF4A3 8FF3F7 Ⅾ â…€ Ⅾ
+8FF3F8 8FF4A4 8FF3F8 ⅵ Ⅵ ⅵ
+8FF3F9 8FF4A5 8FF3F9 ⅶ Ⅹ ⅶ
+8FF3FA 8FF4A6 8FF3FA ⅷ Ⅷ ⅷ
+8FF3FB 8FF4A7 8FF3FB ⅾ ⅹ ⅾ
+8FF3FC 8FF4A8 8FF3FC ⅹ Ⅹ ⅹ
+8FF3FD 8FF3FD 8FF3F3 Ⅰ Ⅰ ⅰ
+8FF3FE 8FF3FE 8FF3F4 Ⅱ Ⅱ ⅱ
+8FF4A1 8FF4A1 8FF3F5 Ⅲ Ⅲ ⅲ
+8FF4A2 8FF4A2 8FF3F6 Ⅳ Ⅳ ⅳ
+8FF4A3 8FF4A3 8FF3F7 â…€ â…€ Ⅾ
+8FF4A4 8FF4A4 8FF3F8 Ⅵ Ⅵ ⅵ
+8FF4A5 8FF4A5 8FF3F9 Ⅹ Ⅹ ⅶ
+8FF4A6 8FF4A6 8FF3FA Ⅷ Ⅷ ⅷ
+8FF4A7 8FF4A7 8FF3FB ⅹ ⅹ ⅾ
+8FF4A8 8FF4A8 8FF3FC Ⅹ Ⅹ ⅹ
+A2F2 A2F2 8FABA9 Å Å å
+A3C1 A3C1 A3E1   
+A3C2 A3C2 A3E2   
+A3C3 A3C3 A3E3   
+A3C4 A3C4 A3E4   
+A3C5 A3C5 A3E5   
+A3C6 A3C6 A3E6   
+A3C7 A3C7 A3E7   
+A3C8 A3C8 A3E8   
+A3C9 A3C9 A3E9   
+A3CA A3CA A3EA   
+A3CB A3CB A3EB   
+A3CC A3CC A3EC   
+A3CD A3CD A3ED   
+A3CE A3CE A3EE   
+A3CF A3CF A3EF   
+A3D0 A3D0 A3F0   
+A3D1 A3D1 A3F1   
+A3D2 A3D2 A3F2   
+A3D3 A3D3 A3F3   
+A3D4 A3D4 A3F4   
+A3D5 A3D5 A3F5   
+A3D6 A3D6 A3F6   
+A3D7 A3D7 A3F7   
+A3D8 A3D8 A3F8   
+A3D9 A3D9 A3F9   
+A3DA A3DA A3FA   
+A3E1 A3C1 A3E1   
+A3E2 A3C2 A3E2   
+A3E3 A3C3 A3E3   
+A3E4 A3C4 A3E4   
+A3E5 A3C5 A3E5   
+A3E6 A3C6 A3E6   
+A3E7 A3C7 A3E7   
+A3E8 A3C8 A3E8   
+A3E9 A3C9 A3E9   
+A3EA A3CA A3EA   
+A3EB A3CB A3EB   
+A3EC A3CC A3EC   
+A3ED A3CD A3ED   
+A3EE A3CE A3EE   
+A3EF A3CF A3EF   
+A3F0 A3D0 A3F0   
+A3F1 A3D1 A3F1   
+A3F2 A3D2 A3F2   
+A3F3 A3D3 A3F3   
+A3F4 A3D4 A3F4   
+A3F5 A3D5 A3F5   
+A3F6 A3D6 A3F6   
+A3F7 A3D7 A3F7   
+A3F8 A3D8 A3F8   
+A3F9 A3D9 A3F9   
+A3FA A3DA A3FA   
+A6A1 A6A1 A6C1 Α Α α
+A6A2 A6A2 A6C2 Β Β β
+A6A3 A6A3 A6C3 Γ Γ γ
+A6A4 A6A4 A6C4 Δ Δ ή
+A6A5 A6A5 A6C5 Ε Ε ε
+A6A6 A6A6 A6C6 Ζ Ζ ζ
+A6A7 A6A7 A6C7 Η Η η
+A6A8 A6A8 A6C8 Θ Θ Ξ
+A6A9 A6A9 A6C9 Ι Ι ι
+A6AA A6AA A6CA Κ Κ κ
+A6AB A6AB A6CB Λ Λ λ
+A6AC A6AC A6CC Μ Μ ÎŒ
+A6AD A6AD A6CD Ν Ν Μ
+A6AE A6AE A6CE Ξ Ξ Ο
+A6AF A6AF A6CF Ο Ο ο
+A6B0 A6B0 A6D0 Π Π π
+A6B1 A6B1 A6D1 Ρ Ρ ρ
+A6B2 A6B2 A6D2 Σ Σ σ
+A6B3 A6B3 A6D3 ΀ ΀ τ
+A6B4 A6B4 A6D4 Υ Υ υ
+A6B5 A6B5 A6D5 Ί Ί φ
+A6B6 A6B6 A6D6 Χ Χ χ
+A6B7 A6B7 A6D7 Κ Κ ψ
+A6B8 A6B8 A6D8 Ω Ω ω
+A6C1 A6A1 A6C1 α Α α
+A6C2 A6A2 A6C2 β Β β
+A6C3 A6A3 A6C3 γ Γ γ
+A6C4 A6A4 A6C4 ή Δ ή
+A6C5 A6A5 A6C5 ε Ε ε
+A6C6 A6A6 A6C6 ζ Ζ ζ
+A6C7 A6A7 A6C7 η Η η
+A6C8 A6A8 A6C8 Ξ Θ Ξ
+A6C9 A6A9 A6C9 ι Ι ι
+A6CA A6AA A6CA κ Κ κ
+A6CB A6AB A6CB λ Λ λ
+A6CC A6AC A6CC ÎŒ Μ ÎŒ
+A6CD A6AD A6CD Μ Ν Μ
+A6CE A6AE A6CE Ο Ξ Ο
+A6CF A6AF A6CF ο Ο ο
+A6D0 A6B0 A6D0 π Π π
+A6D1 A6B1 A6D1 ρ Ρ ρ
+A6D2 A6B2 A6D2 σ Σ σ
+A6D3 A6B3 A6D3 τ ΀ τ
+A6D4 A6B4 A6D4 υ Υ υ
+A6D5 A6B5 A6D5 φ Ί φ
+A6D6 A6B6 A6D6 χ Χ χ
+A6D7 A6B7 A6D7 ψ Κ ψ
+A6D8 A6B8 A6D8 ω Ω ω
+A7A1 A7A1 A7D1 А А а
+A7A2 A7A2 A7D2 Б Б б
+A7A3 A7A3 A7D3 В В в
+A7A4 A7A4 A7D4 Г Г г
+A7A5 A7A5 A7D5 Д Д ÐŽ
+A7A6 A7A6 A7D6 Е Е е
+A7A7 A7A7 A7D7 Ё Ё ё
+A7A8 A7A8 A7D8 Ж Ж ж
+A7A9 A7A9 A7D9 З З з
+A7AA A7AA A7DA И И О
+A7AB A7AB A7DB Й Й й
+A7AC A7AC A7DC К К к
+A7AD A7AD A7DD Л Л л
+A7AE A7AE A7DE М М ÐŒ
+A7AF A7AF A7DF Н Н М
+A7B0 A7B0 A7E0 О О П
+A7B1 A7B1 A7E1 П П п
+A7B2 A7B2 A7E2 Р Р р
+A7B3 A7B3 A7E3 С С с
+A7B4 A7B4 A7E4 Т Т т
+A7B5 A7B5 A7E5 У У у
+A7B6 A7B6 A7E6 Ѐ Ѐ ф
+A7B7 A7B7 A7E7 Х Х х
+A7B8 A7B8 A7E8 Њ Њ ц
+A7B9 A7B9 A7E9 Ч Ч ч
+A7BA A7BA A7EA К К ш
+A7BB A7BB A7EB Щ Щ щ
+A7BC A7BC A7EC Ъ Ъ ъ
+A7BD A7BD A7ED Ы Ы ы
+A7BE A7BE A7EE Ь Ь ь
+A7BF A7BF A7EF Э Э э
+A7C0 A7C0 A7F0 Ю Ю ю
+A7C1 A7C1 A7F1 Я Я я
+A7D1 A7A1 A7D1 а А а
+A7D2 A7A2 A7D2 б Б б
+A7D3 A7A3 A7D3 в В в
+A7D4 A7A4 A7D4 г Г г
+A7D5 A7A5 A7D5 ÐŽ Д ÐŽ
+A7D6 A7A6 A7D6 е Е е
+A7D7 A7A7 A7D7 ё Ё ё
+A7D8 A7A8 A7D8 ж Ж ж
+A7D9 A7A9 A7D9 з З з
+A7DA A7AA A7DA О И О
+A7DB A7AB A7DB й Й й
+A7DC A7AC A7DC к К к
+A7DD A7AD A7DD л Л л
+A7DE A7AE A7DE ÐŒ М ÐŒ
+A7DF A7AF A7DF М Н М
+A7E0 A7B0 A7E0 П О П
+A7E1 A7B1 A7E1 п П п
+A7E2 A7B2 A7E2 р Р р
+A7E3 A7B3 A7E3 с С с
+A7E4 A7B4 A7E4 т Т т
+A7E5 A7B5 A7E5 у У у
+A7E6 A7B6 A7E6 ф Ѐ ф
+A7E7 A7B7 A7E7 х Х х
+A7E8 A7B8 A7E8 ц Њ ц
+A7E9 A7B9 A7E9 ч Ч ч
+A7EA A7BA A7EA ш К ш
+A7EB A7BB A7EB щ Щ щ
+A7EC A7BC A7EC ъ Ъ ъ
+A7ED A7BD A7ED ы Ы ы
+A7EE A7BE A7EE ь Ь ь
+A7EF A7BF A7EF э Э э
+A7F0 A7C0 A7F0 ю Ю ю
+A7F1 A7C1 A7F1 я Я я
+ADB5 ADB5 8FF3F3 Ⅰ Ⅰ ⅰ
+ADB6 ADB6 8FF3F4 Ⅱ Ⅱ ⅱ
+ADB7 ADB7 8FF3F5 Ⅲ Ⅲ ⅲ
+ADB8 ADB8 8FF3F6 Ⅳ Ⅳ ⅳ
+ADB9 ADB9 8FF3F7 â…€ â…€ Ⅾ
+ADBA ADBA 8FF3F8 Ⅵ Ⅵ ⅵ
+ADBB ADBB 8FF3F9 Ⅹ Ⅹ ⅶ
+ADBC ADBC 8FF3FA Ⅷ Ⅷ ⅷ
+ADBD ADBD 8FF3FB ⅹ ⅹ ⅾ
+ADBE ADBE 8FF3FC Ⅹ Ⅹ ⅹ
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+8FAABC Ģ
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+8FA9C3 ð
+8FABB9 ǵ
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result
index 3cc74864400..c20504e9ed7 100644
--- a/mysql-test/r/ctype_euckr.result
+++ b/mysql-test/r/ctype_euckr.result
@@ -24255,3 +24255,350 @@ FDFD FDFD E7BEB2 FDFD
FDFE FDFE E8A9B0 FDFE
DROP TABLE t1, t2;
End of 5.4 tests
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=euckr_korean_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT concat(head, tail) AS code, ' ' AS a
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(8) DEFAULT NULL,
+ `a` varchar(1) CHARACTER SET euckr NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1 WHERE a<>'';
+COUNT(*)
+22428
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+A3C1 A3C1 A3E1   
+A3C2 A3C2 A3E2   
+A3C3 A3C3 A3E3   
+A3C4 A3C4 A3E4   
+A3C5 A3C5 A3E5   
+A3C6 A3C6 A3E6   
+A3C7 A3C7 A3E7   
+A3C8 A3C8 A3E8   
+A3C9 A3C9 A3E9   
+A3CA A3CA A3EA   
+A3CB A3CB A3EB   
+A3CC A3CC A3EC   
+A3CD A3CD A3ED   
+A3CE A3CE A3EE   
+A3CF A3CF A3EF   
+A3D0 A3D0 A3F0   
+A3D1 A3D1 A3F1   
+A3D2 A3D2 A3F2   
+A3D3 A3D3 A3F3   
+A3D4 A3D4 A3F4   
+A3D5 A3D5 A3F5   
+A3D6 A3D6 A3F6   
+A3D7 A3D7 A3F7   
+A3D8 A3D8 A3F8   
+A3D9 A3D9 A3F9   
+A3DA A3DA A3FA   
+A3E1 A3C1 A3E1   
+A3E2 A3C2 A3E2   
+A3E3 A3C3 A3E3   
+A3E4 A3C4 A3E4   
+A3E5 A3C5 A3E5   
+A3E6 A3C6 A3E6   
+A3E7 A3C7 A3E7   
+A3E8 A3C8 A3E8   
+A3E9 A3C9 A3E9   
+A3EA A3CA A3EA   
+A3EB A3CB A3EB   
+A3EC A3CC A3EC   
+A3ED A3CD A3ED   
+A3EE A3CE A3EE   
+A3EF A3CF A3EF   
+A3F0 A3D0 A3F0   
+A3F1 A3D1 A3F1   
+A3F2 A3D2 A3F2   
+A3F3 A3D3 A3F3   
+A3F4 A3D4 A3F4   
+A3F5 A3D5 A3F5   
+A3F6 A3D6 A3F6   
+A3F7 A3D7 A3F7   
+A3F8 A3D8 A3F8   
+A3F9 A3D9 A3F9   
+A3FA A3DA A3FA   
+A5A1 A5B0 A5A1 ⅰ Ⅰ ⅰ
+A5A2 A5B1 A5A2 ⅱ Ⅱ ⅱ
+A5A3 A5B2 A5A3 ⅲ Ⅲ ⅲ
+A5A4 A5B3 A5A4 ⅳ Ⅳ ⅳ
+A5A5 A5B4 A5A5 Ⅾ â…€ Ⅾ
+A5A6 A5B5 A5A6 ⅵ Ⅵ ⅵ
+A5A7 A5B6 A5A7 ⅶ Ⅹ ⅶ
+A5A8 A5B7 A5A8 ⅷ Ⅷ ⅷ
+A5A9 A5B8 A5A9 ⅾ ⅹ ⅾ
+A5AA A5B9 A5AA ⅹ Ⅹ ⅹ
+A5B0 A5B0 A5A1 Ⅰ Ⅰ ⅰ
+A5B1 A5B1 A5A2 Ⅱ Ⅱ ⅱ
+A5B2 A5B2 A5A3 Ⅲ Ⅲ ⅲ
+A5B3 A5B3 A5A4 Ⅳ Ⅳ ⅳ
+A5B4 A5B4 A5A5 â…€ â…€ Ⅾ
+A5B5 A5B5 A5A6 Ⅵ Ⅵ ⅵ
+A5B6 A5B6 A5A7 Ⅹ Ⅹ ⅶ
+A5B7 A5B7 A5A8 Ⅷ Ⅷ ⅷ
+A5B8 A5B8 A5A9 ⅹ ⅹ ⅾ
+A5B9 A5B9 A5AA Ⅹ Ⅹ ⅹ
+A5C1 A5C1 A5E1 Α Α α
+A5C2 A5C2 A5E2 Β Β β
+A5C3 A5C3 A5E3 Γ Γ γ
+A5C4 A5C4 A5E4 Δ Δ ή
+A5C5 A5C5 A5E5 Ε Ε ε
+A5C6 A5C6 A5E6 Ζ Ζ ζ
+A5C7 A5C7 A5E7 Η Η η
+A5C8 A5C8 A5E8 Θ Θ Ξ
+A5C9 A5C9 A5E9 Ι Ι ι
+A5CA A5CA A5EA Κ Κ κ
+A5CB A5CB A5EB Λ Λ λ
+A5CC A5CC A5EC Μ Μ ÎŒ
+A5CD A5CD A5ED Ν Ν Μ
+A5CE A5CE A5EE Ξ Ξ Ο
+A5CF A5CF A5EF Ο Ο ο
+A5D0 A5D0 A5F0 Π Π π
+A5D1 A5D1 A5F1 Ρ Ρ ρ
+A5D2 A5D2 A5F2 Σ Σ σ
+A5D3 A5D3 A5F3 ΀ ΀ τ
+A5D4 A5D4 A5F4 Υ Υ υ
+A5D5 A5D5 A5F5 Ί Ί φ
+A5D6 A5D6 A5F6 Χ Χ χ
+A5D7 A5D7 A5F7 Κ Κ ψ
+A5D8 A5D8 A5F8 Ω Ω ω
+A5E1 A5C1 A5E1 α Α α
+A5E2 A5C2 A5E2 β Β β
+A5E3 A5C3 A5E3 γ Γ γ
+A5E4 A5C4 A5E4 ή Δ ή
+A5E5 A5C5 A5E5 ε Ε ε
+A5E6 A5C6 A5E6 ζ Ζ ζ
+A5E7 A5C7 A5E7 η Η η
+A5E8 A5C8 A5E8 Ξ Θ Ξ
+A5E9 A5C9 A5E9 ι Ι ι
+A5EA A5CA A5EA κ Κ κ
+A5EB A5CB A5EB λ Λ λ
+A5EC A5CC A5EC ÎŒ Μ ÎŒ
+A5ED A5CD A5ED Μ Ν Μ
+A5EE A5CE A5EE Ο Ξ Ο
+A5EF A5CF A5EF ο Ο ο
+A5F0 A5D0 A5F0 π Π π
+A5F1 A5D1 A5F1 ρ Ρ ρ
+A5F2 A5D2 A5F2 σ Σ σ
+A5F3 A5D3 A5F3 τ ΀ τ
+A5F4 A5D4 A5F4 υ Υ υ
+A5F5 A5D5 A5F5 φ Ί φ
+A5F6 A5D6 A5F6 χ Χ χ
+A5F7 A5D7 A5F7 ψ Κ ψ
+A5F8 A5D8 A5F8 ω Ω ω
+A7D9 A7D9 A5F8 ℩ ℩ ω
+A8A1 A8A1 A9A1 Æ Æ Ê
+A8A2 A8A2 A9A3 Ð Ð ð
+A8A4 A8A4 A9A4 Ċ Ċ ħ
+A8A6 A8A6 A9A6 IJ IJ ij
+A8A8 A8A8 A9A8 Ŀ Ŀ ŀ
+A8A9 A8A9 A9A9 Ł Ł ł
+A8AA A8AA A9AA Ø Ø Þ
+A8AB A8AB A9AB Œ Œ œ
+A8AD A8AD A9AD Þ Þ ß
+A8AE A8AE A9AE Ŋ Ŋ ŧ
+A8AF A8AF A9AF Ŋ Ŋ ŋ
+A9A1 A8A1 A9A1 Ê Æ Ê
+A9A3 A8A2 A9A3 ð Ð ð
+A9A4 A8A4 A9A4 ħ Ċ ħ
+A9A5 49 A9A5 ı I ı
+A9A6 A8A6 A9A6 ij IJ ij
+A9A8 A8A8 A9A8 ŀ Ŀ ŀ
+A9A9 A8A9 A9A9 ł Ł ł
+A9AA A8AA A9AA Þ Ø Þ
+A9AB A8AB A9AB œ Œ œ
+A9AD A8AD A9AD ß Þ ß
+A9AE A8AE A9AE ŧ Ŋ ŧ
+A9AF A8AF A9AF ŋ Ŋ ŋ
+ACA1 ACA1 ACD1 А А а
+ACA2 ACA2 ACD2 Б Б б
+ACA3 ACA3 ACD3 В В в
+ACA4 ACA4 ACD4 Г Г г
+ACA5 ACA5 ACD5 Д Д ÐŽ
+ACA6 ACA6 ACD6 Е Е е
+ACA7 ACA7 ACD7 Ё Ё ё
+ACA8 ACA8 ACD8 Ж Ж ж
+ACA9 ACA9 ACD9 З З з
+ACAA ACAA ACDA И И О
+ACAB ACAB ACDB Й Й й
+ACAC ACAC ACDC К К к
+ACAD ACAD ACDD Л Л л
+ACAE ACAE ACDE М М ÐŒ
+ACAF ACAF ACDF Н Н М
+ACB0 ACB0 ACE0 О О П
+ACB1 ACB1 ACE1 П П п
+ACB2 ACB2 ACE2 Р Р р
+ACB3 ACB3 ACE3 С С с
+ACB4 ACB4 ACE4 Т Т т
+ACB5 ACB5 ACE5 У У у
+ACB6 ACB6 ACE6 Ѐ Ѐ ф
+ACB7 ACB7 ACE7 Х Х х
+ACB8 ACB8 ACE8 Њ Њ ц
+ACB9 ACB9 ACE9 Ч Ч ч
+ACBA ACBA ACEA К К ш
+ACBB ACBB ACEB Щ Щ щ
+ACBC ACBC ACEC Ъ Ъ ъ
+ACBD ACBD ACED Ы Ы ы
+ACBE ACBE ACEE Ь Ь ь
+ACBF ACBF ACEF Э Э э
+ACC0 ACC0 ACF0 Ю Ю ю
+ACC1 ACC1 ACF1 Я Я я
+ACD1 ACA1 ACD1 а А а
+ACD2 ACA2 ACD2 б Б б
+ACD3 ACA3 ACD3 в В в
+ACD4 ACA4 ACD4 г Г г
+ACD5 ACA5 ACD5 ÐŽ Д ÐŽ
+ACD6 ACA6 ACD6 е Е е
+ACD7 ACA7 ACD7 ё Ё ё
+ACD8 ACA8 ACD8 ж Ж ж
+ACD9 ACA9 ACD9 з З з
+ACDA ACAA ACDA О И О
+ACDB ACAB ACDB й Й й
+ACDC ACAC ACDC к К к
+ACDD ACAD ACDD л Л л
+ACDE ACAE ACDE ÐŒ М ÐŒ
+ACDF ACAF ACDF М Н М
+ACE0 ACB0 ACE0 П О П
+ACE1 ACB1 ACE1 п П п
+ACE2 ACB2 ACE2 р Р р
+ACE3 ACB3 ACE3 с С с
+ACE4 ACB4 ACE4 т Т т
+ACE5 ACB5 ACE5 у У у
+ACE6 ACB6 ACE6 ф Ѐ ф
+ACE7 ACB7 ACE7 х Х х
+ACE8 ACB8 ACE8 ц Њ ц
+ACE9 ACB9 ACE9 ч Ч ч
+ACEA ACBA ACEA ш К ш
+ACEB ACBB ACEB щ Щ щ
+ACEC ACBC ACEC ъ Ъ ъ
+ACED ACBD ACED ы Ы ы
+ACEE ACBE ACEE ь Ь ь
+ACEF ACBF ACEF э Э э
+ACF0 ACC0 ACF0 ю Ю ю
+ACF1 ACC1 ACF1 я Я я
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+A1CA Å
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+A8CD ⓐ
+A8CE ⓑ
+A8CF ⓒ
+A8D0 ⓓ
+A8D1 ⓔ
+A8D2 ⓕ
+A8D3 ⓖ
+A8D4 ⓗ
+A8D5 ⓘ
+A8D6 ⓙ
+A8D7 ⓚ
+A8D8 ⓛ
+A8D9 ⓜ
+A8DA ⓝ
+A8DB ⓞ
+A8DC ⓟ
+A8DD ⓠ
+A8DE ⓡ
+A8DF ⓢ
+A8E0 ⓣ
+A8E1 â“€
+A8E2 ⓥ
+A8E3 ⓩ
+A8E4 ⓧ
+A8E5 ⓹
+A8E6 ⓩ
+A9A2 đ
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result
index 2f789ab5b13..9e9888aecd8 100644
--- a/mysql-test/r/ctype_gb2312.result
+++ b/mysql-test/r/ctype_gb2312.result
@@ -235,3 +235,316 @@ hex(a)
A2A1
D7FE
DROP TABLE t1;
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=gb2312_chinese_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT concat(head, tail) AS code, ' ' AS a
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(8) DEFAULT NULL,
+ `a` varchar(1) CHARACTER SET gb2312 NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1 WHERE a<>'';
+COUNT(*)
+8178
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+A3C1 A3C1 A3E1   
+A3C2 A3C2 A3E2   
+A3C3 A3C3 A3E3   
+A3C4 A3C4 A3E4   
+A3C5 A3C5 A3E5   
+A3C6 A3C6 A3E6   
+A3C7 A3C7 A3E7   
+A3C8 A3C8 A3E8   
+A3C9 A3C9 A3E9   
+A3CA A3CA A3EA   
+A3CB A3CB A3EB   
+A3CC A3CC A3EC   
+A3CD A3CD A3ED   
+A3CE A3CE A3EE   
+A3CF A3CF A3EF   
+A3D0 A3D0 A3F0   
+A3D1 A3D1 A3F1   
+A3D2 A3D2 A3F2   
+A3D3 A3D3 A3F3   
+A3D4 A3D4 A3F4   
+A3D5 A3D5 A3F5   
+A3D6 A3D6 A3F6   
+A3D7 A3D7 A3F7   
+A3D8 A3D8 A3F8   
+A3D9 A3D9 A3F9   
+A3DA A3DA A3FA   
+A3E1 A3C1 A3E1   
+A3E2 A3C2 A3E2   
+A3E3 A3C3 A3E3   
+A3E4 A3C4 A3E4   
+A3E5 A3C5 A3E5   
+A3E6 A3C6 A3E6   
+A3E7 A3C7 A3E7   
+A3E8 A3C8 A3E8   
+A3E9 A3C9 A3E9   
+A3EA A3CA A3EA   
+A3EB A3CB A3EB   
+A3EC A3CC A3EC   
+A3ED A3CD A3ED   
+A3EE A3CE A3EE   
+A3EF A3CF A3EF   
+A3F0 A3D0 A3F0   
+A3F1 A3D1 A3F1   
+A3F2 A3D2 A3F2   
+A3F3 A3D3 A3F3   
+A3F4 A3D4 A3F4   
+A3F5 A3D5 A3F5   
+A3F6 A3D6 A3F6   
+A3F7 A3D7 A3F7   
+A3F8 A3D8 A3F8   
+A3F9 A3D9 A3F9   
+A3FA A3DA A3FA   
+A6A1 A6A1 A6C1 Α Α α
+A6A2 A6A2 A6C2 Β Β β
+A6A3 A6A3 A6C3 Γ Γ γ
+A6A4 A6A4 A6C4 Δ Δ ή
+A6A5 A6A5 A6C5 Ε Ε ε
+A6A6 A6A6 A6C6 Ζ Ζ ζ
+A6A7 A6A7 A6C7 Η Η η
+A6A8 A6A8 A6C8 Θ Θ Ξ
+A6A9 A6A9 A6C9 Ι Ι ι
+A6AA A6AA A6CA Κ Κ κ
+A6AB A6AB A6CB Λ Λ λ
+A6AC A6AC A6CC Μ Μ ÎŒ
+A6AD A6AD A6CD Ν Ν Μ
+A6AE A6AE A6CE Ξ Ξ Ο
+A6AF A6AF A6CF Ο Ο ο
+A6B0 A6B0 A6D0 Π Π π
+A6B1 A6B1 A6D1 Ρ Ρ ρ
+A6B2 A6B2 A6D2 Σ Σ σ
+A6B3 A6B3 A6D3 ΀ ΀ τ
+A6B4 A6B4 A6D4 Υ Υ υ
+A6B5 A6B5 A6D5 Ί Ί φ
+A6B6 A6B6 A6D6 Χ Χ χ
+A6B7 A6B7 A6D7 Κ Κ ψ
+A6B8 A6B8 A6D8 Ω Ω ω
+A6C1 A6A1 A6C1 α Α α
+A6C2 A6A2 A6C2 β Β β
+A6C3 A6A3 A6C3 γ Γ γ
+A6C4 A6A4 A6C4 ή Δ ή
+A6C5 A6A5 A6C5 ε Ε ε
+A6C6 A6A6 A6C6 ζ Ζ ζ
+A6C7 A6A7 A6C7 η Η η
+A6C8 A6A8 A6C8 Ξ Θ Ξ
+A6C9 A6A9 A6C9 ι Ι ι
+A6CA A6AA A6CA κ Κ κ
+A6CB A6AB A6CB λ Λ λ
+A6CC A6AC A6CC ÎŒ Μ ÎŒ
+A6CD A6AD A6CD Μ Ν Μ
+A6CE A6AE A6CE Ο Ξ Ο
+A6CF A6AF A6CF ο Ο ο
+A6D0 A6B0 A6D0 π Π π
+A6D1 A6B1 A6D1 ρ Ρ ρ
+A6D2 A6B2 A6D2 σ Σ σ
+A6D3 A6B3 A6D3 τ ΀ τ
+A6D4 A6B4 A6D4 υ Υ υ
+A6D5 A6B5 A6D5 φ Ί φ
+A6D6 A6B6 A6D6 χ Χ χ
+A6D7 A6B7 A6D7 ψ Κ ψ
+A6D8 A6B8 A6D8 ω Ω ω
+A7A1 A7A1 A7D1 А А а
+A7A2 A7A2 A7D2 Б Б б
+A7A3 A7A3 A7D3 В В в
+A7A4 A7A4 A7D4 Г Г г
+A7A5 A7A5 A7D5 Д Д ÐŽ
+A7A6 A7A6 A7D6 Е Е е
+A7A7 A7A7 A7D7 Ё Ё ё
+A7A8 A7A8 A7D8 Ж Ж ж
+A7A9 A7A9 A7D9 З З з
+A7AA A7AA A7DA И И О
+A7AB A7AB A7DB Й Й й
+A7AC A7AC A7DC К К к
+A7AD A7AD A7DD Л Л л
+A7AE A7AE A7DE М М ÐŒ
+A7AF A7AF A7DF Н Н М
+A7B0 A7B0 A7E0 О О П
+A7B1 A7B1 A7E1 П П п
+A7B2 A7B2 A7E2 Р Р р
+A7B3 A7B3 A7E3 С С с
+A7B4 A7B4 A7E4 Т Т т
+A7B5 A7B5 A7E5 У У у
+A7B6 A7B6 A7E6 Ѐ Ѐ ф
+A7B7 A7B7 A7E7 Х Х х
+A7B8 A7B8 A7E8 Њ Њ ц
+A7B9 A7B9 A7E9 Ч Ч ч
+A7BA A7BA A7EA К К ш
+A7BB A7BB A7EB Щ Щ щ
+A7BC A7BC A7EC Ъ Ъ ъ
+A7BD A7BD A7ED Ы Ы ы
+A7BE A7BE A7EE Ь Ь ь
+A7BF A7BF A7EF Э Э э
+A7C0 A7C0 A7F0 Ю Ю ю
+A7C1 A7C1 A7F1 Я Я я
+A7D1 A7A1 A7D1 а А а
+A7D2 A7A2 A7D2 б Б б
+A7D3 A7A3 A7D3 в В в
+A7D4 A7A4 A7D4 г Г г
+A7D5 A7A5 A7D5 ÐŽ Д ÐŽ
+A7D6 A7A6 A7D6 е Е е
+A7D7 A7A7 A7D7 ё Ё ё
+A7D8 A7A8 A7D8 ж Ж ж
+A7D9 A7A9 A7D9 з З з
+A7DA A7AA A7DA О И О
+A7DB A7AB A7DB й Й й
+A7DC A7AC A7DC к К к
+A7DD A7AD A7DD л Л л
+A7DE A7AE A7DE ÐŒ М ÐŒ
+A7DF A7AF A7DF М Н М
+A7E0 A7B0 A7E0 П О П
+A7E1 A7B1 A7E1 п П п
+A7E2 A7B2 A7E2 р Р р
+A7E3 A7B3 A7E3 с С с
+A7E4 A7B4 A7E4 т Т т
+A7E5 A7B5 A7E5 у У у
+A7E6 A7B6 A7E6 ф Ѐ ф
+A7E7 A7B7 A7E7 х Х х
+A7E8 A7B8 A7E8 ц Њ ц
+A7E9 A7B9 A7E9 ч Ч ч
+A7EA A7BA A7EA ш К ш
+A7EB A7BB A7EB щ Щ щ
+A7EC A7BC A7EC ъ Ъ ъ
+A7ED A7BD A7ED ы Ы ы
+A7EE A7BE A7EE ь Ь ь
+A7EF A7BF A7EF э Э э
+A7F0 A7C0 A7F0 ю Ю ю
+A7F1 A7C1 A7F1 я Я я
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+A2F1 Ⅰ
+A2F2 Ⅱ
+A2F3 Ⅲ
+A2F4 Ⅳ
+A2F5 â…€
+A2F6 Ⅵ
+A2F7 Ⅹ
+A2F8 Ⅷ
+A2F9 ⅹ
+A2FA Ⅹ
+A2FB Ⅺ
+A2FC Ⅻ
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+A8A1 ā
+A8A2 á
+A8A3 ǎ
+A8A4 à
+A8A5 ē
+A8A6 é
+A8A7 ě
+A8A8 Ú
+A8A9 Ä«
+A8AA í
+A8AB ǐ
+A8AC ì
+A8AD ō
+A8AE ó
+A8AF ǒ
+A8B0 ò
+A8B1 Å«
+A8B2 ú
+A8B3 ǔ
+A8B4 ù
+A8B5 ǖ
+A8B6 ǘ
+A8B7 ǚ
+A8B8 ǜ
+A8B9 Ì
+A8BA ê
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result
index c144ed6881d..0abbbec1d7b 100644
--- a/mysql-test/r/ctype_gbk.result
+++ b/mysql-test/r/ctype_gbk.result
@@ -255,3 +255,328 @@ SELECT a FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
SELECT b FROM t1 GROUP BY 1 LIMIT 1 INTO @nullll;
DROP TABLES t1;
End of 5.0 tests
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=gbk_chinese_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT concat(head, tail) AS code, ' ' AS a
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(8) DEFAULT NULL,
+ `a` varchar(1) CHARACTER SET gbk NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1 WHERE a<>'';
+COUNT(*)
+23940
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a));
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+A2A1 A2F1 A2A1 ⅰ Ⅰ ⅰ
+A2A2 A2F2 A2A2 ⅱ Ⅱ ⅱ
+A2A3 A2F3 A2A3 ⅲ Ⅲ ⅲ
+A2A4 A2F4 A2A4 ⅳ Ⅳ ⅳ
+A2A5 A2F5 A2A5 Ⅾ â…€ Ⅾ
+A2A6 A2F6 A2A6 ⅵ Ⅵ ⅵ
+A2A7 A2F7 A2A7 ⅶ Ⅹ ⅶ
+A2A8 A2F8 A2A8 ⅷ Ⅷ ⅷ
+A2A9 A2F9 A2A9 ⅾ ⅹ ⅾ
+A2AA A2FA A2AA ⅹ Ⅹ ⅹ
+A2F1 A2F1 A2A1 Ⅰ Ⅰ ⅰ
+A2F2 A2F2 A2A2 Ⅱ Ⅱ ⅱ
+A2F3 A2F3 A2A3 Ⅲ Ⅲ ⅲ
+A2F4 A2F4 A2A4 Ⅳ Ⅳ ⅳ
+A2F5 A2F5 A2A5 â…€ â…€ Ⅾ
+A2F6 A2F6 A2A6 Ⅵ Ⅵ ⅵ
+A2F7 A2F7 A2A7 Ⅹ Ⅹ ⅶ
+A2F8 A2F8 A2A8 Ⅷ Ⅷ ⅷ
+A2F9 A2F9 A2A9 ⅹ ⅹ ⅾ
+A2FA A2FA A2AA Ⅹ Ⅹ ⅹ
+A3C1 A3C1 A3E1   
+A3C2 A3C2 A3E2   
+A3C3 A3C3 A3E3   
+A3C4 A3C4 A3E4   
+A3C5 A3C5 A3E5   
+A3C6 A3C6 A3E6   
+A3C7 A3C7 A3E7   
+A3C8 A3C8 A3E8   
+A3C9 A3C9 A3E9   
+A3CA A3CA A3EA   
+A3CB A3CB A3EB   
+A3CC A3CC A3EC   
+A3CD A3CD A3ED   
+A3CE A3CE A3EE   
+A3CF A3CF A3EF   
+A3D0 A3D0 A3F0   
+A3D1 A3D1 A3F1   
+A3D2 A3D2 A3F2   
+A3D3 A3D3 A3F3   
+A3D4 A3D4 A3F4   
+A3D5 A3D5 A3F5   
+A3D6 A3D6 A3F6   
+A3D7 A3D7 A3F7   
+A3D8 A3D8 A3F8   
+A3D9 A3D9 A3F9   
+A3DA A3DA A3FA   
+A3E1 A3C1 A3E1   
+A3E2 A3C2 A3E2   
+A3E3 A3C3 A3E3   
+A3E4 A3C4 A3E4   
+A3E5 A3C5 A3E5   
+A3E6 A3C6 A3E6   
+A3E7 A3C7 A3E7   
+A3E8 A3C8 A3E8   
+A3E9 A3C9 A3E9   
+A3EA A3CA A3EA   
+A3EB A3CB A3EB   
+A3EC A3CC A3EC   
+A3ED A3CD A3ED   
+A3EE A3CE A3EE   
+A3EF A3CF A3EF   
+A3F0 A3D0 A3F0   
+A3F1 A3D1 A3F1   
+A3F2 A3D2 A3F2   
+A3F3 A3D3 A3F3   
+A3F4 A3D4 A3F4   
+A3F5 A3D5 A3F5   
+A3F6 A3D6 A3F6   
+A3F7 A3D7 A3F7   
+A3F8 A3D8 A3F8   
+A3F9 A3D9 A3F9   
+A3FA A3DA A3FA   
+A6A1 A6A1 A6C1 Α Α α
+A6A2 A6A2 A6C2 Β Β β
+A6A3 A6A3 A6C3 Γ Γ γ
+A6A4 A6A4 A6C4 Δ Δ ή
+A6A5 A6A5 A6C5 Ε Ε ε
+A6A6 A6A6 A6C6 Ζ Ζ ζ
+A6A7 A6A7 A6C7 Η Η η
+A6A8 A6A8 A6C8 Θ Θ Ξ
+A6A9 A6A9 A6C9 Ι Ι ι
+A6AA A6AA A6CA Κ Κ κ
+A6AB A6AB A6CB Λ Λ λ
+A6AC A6AC A6CC Μ Μ ÎŒ
+A6AD A6AD A6CD Ν Ν Μ
+A6AE A6AE A6CE Ξ Ξ Ο
+A6AF A6AF A6CF Ο Ο ο
+A6B0 A6B0 A6D0 Π Π π
+A6B1 A6B1 A6D1 Ρ Ρ ρ
+A6B2 A6B2 A6D2 Σ Σ σ
+A6B3 A6B3 A6D3 ΀ ΀ τ
+A6B4 A6B4 A6D4 Υ Υ υ
+A6B5 A6B5 A6D5 Ί Ί φ
+A6B6 A6B6 A6D6 Χ Χ χ
+A6B7 A6B7 A6D7 Κ Κ ψ
+A6B8 A6B8 A6D8 Ω Ω ω
+A6C1 A6A1 A6C1 α Α α
+A6C2 A6A2 A6C2 β Β β
+A6C3 A6A3 A6C3 γ Γ γ
+A6C4 A6A4 A6C4 ή Δ ή
+A6C5 A6A5 A6C5 ε Ε ε
+A6C6 A6A6 A6C6 ζ Ζ ζ
+A6C7 A6A7 A6C7 η Η η
+A6C8 A6A8 A6C8 Ξ Θ Ξ
+A6C9 A6A9 A6C9 ι Ι ι
+A6CA A6AA A6CA κ Κ κ
+A6CB A6AB A6CB λ Λ λ
+A6CC A6AC A6CC ÎŒ Μ ÎŒ
+A6CD A6AD A6CD Μ Ν Μ
+A6CE A6AE A6CE Ο Ξ Ο
+A6CF A6AF A6CF ο Ο ο
+A6D0 A6B0 A6D0 π Π π
+A6D1 A6B1 A6D1 ρ Ρ ρ
+A6D2 A6B2 A6D2 σ Σ σ
+A6D3 A6B3 A6D3 τ ΀ τ
+A6D4 A6B4 A6D4 υ Υ υ
+A6D5 A6B5 A6D5 φ Ί φ
+A6D6 A6B6 A6D6 χ Χ χ
+A6D7 A6B7 A6D7 ψ Κ ψ
+A6D8 A6B8 A6D8 ω Ω ω
+A7A1 A7A1 A7D1 А А а
+A7A2 A7A2 A7D2 Б Б б
+A7A3 A7A3 A7D3 В В в
+A7A4 A7A4 A7D4 Г Г г
+A7A5 A7A5 A7D5 Д Д ÐŽ
+A7A6 A7A6 A7D6 Е Е е
+A7A7 A7A7 A7D7 Ё Ё ё
+A7A8 A7A8 A7D8 Ж Ж ж
+A7A9 A7A9 A7D9 З З з
+A7AA A7AA A7DA И И О
+A7AB A7AB A7DB Й Й й
+A7AC A7AC A7DC К К к
+A7AD A7AD A7DD Л Л л
+A7AE A7AE A7DE М М ÐŒ
+A7AF A7AF A7DF Н Н М
+A7B0 A7B0 A7E0 О О П
+A7B1 A7B1 A7E1 П П п
+A7B2 A7B2 A7E2 Р Р р
+A7B3 A7B3 A7E3 С С с
+A7B4 A7B4 A7E4 Т Т т
+A7B5 A7B5 A7E5 У У у
+A7B6 A7B6 A7E6 Ѐ Ѐ ф
+A7B7 A7B7 A7E7 Х Х х
+A7B8 A7B8 A7E8 Њ Њ ц
+A7B9 A7B9 A7E9 Ч Ч ч
+A7BA A7BA A7EA К К ш
+A7BB A7BB A7EB Щ Щ щ
+A7BC A7BC A7EC Ъ Ъ ъ
+A7BD A7BD A7ED Ы Ы ы
+A7BE A7BE A7EE Ь Ь ь
+A7BF A7BF A7EF Э Э э
+A7C0 A7C0 A7F0 Ю Ю ю
+A7C1 A7C1 A7F1 Я Я я
+A7D1 A7A1 A7D1 а А а
+A7D2 A7A2 A7D2 б Б б
+A7D3 A7A3 A7D3 в В в
+A7D4 A7A4 A7D4 г Г г
+A7D5 A7A5 A7D5 ÐŽ Д ÐŽ
+A7D6 A7A6 A7D6 е Е е
+A7D7 A7A7 A7D7 ё Ё ё
+A7D8 A7A8 A7D8 ж Ж ж
+A7D9 A7A9 A7D9 з З з
+A7DA A7AA A7DA О И О
+A7DB A7AB A7DB й Й й
+A7DC A7AC A7DC к К к
+A7DD A7AD A7DD л Л л
+A7DE A7AE A7DE ÐŒ М ÐŒ
+A7DF A7AF A7DF М Н М
+A7E0 A7B0 A7E0 П О П
+A7E1 A7B1 A7E1 п П п
+A7E2 A7B2 A7E2 р Р р
+A7E3 A7B3 A7E3 с С с
+A7E4 A7B4 A7E4 т Т т
+A7E5 A7B5 A7E5 у У у
+A7E6 A7B6 A7E6 ф Ѐ ф
+A7E7 A7B7 A7E7 х Х х
+A7E8 A7B8 A7E8 ц Њ ц
+A7E9 A7B9 A7E9 ч Ч ч
+A7EA A7BA A7EA ш К ш
+A7EB A7BB A7EB щ Щ щ
+A7EC A7BC A7EC ъ Ъ ъ
+A7ED A7BD A7ED ы Ы ы
+A7EE A7BE A7EE ь Ь ь
+A7EF A7BF A7EF э Э э
+A7F0 A7C0 A7F0 ю Ю ю
+A7F1 A7C1 A7F1 я Я я
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+A2FB Ⅺ
+A2FC Ⅻ
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+A8A1 ā
+A8A2 á
+A8A3 ǎ
+A8A4 à
+A8A5 ē
+A8A6 é
+A8A7 ě
+A8A8 Ú
+A8A9 Ä«
+A8AA í
+A8AB ǐ
+A8AC ì
+A8AD ō
+A8AE ó
+A8AF ǒ
+A8B0 ò
+A8B1 Å«
+A8B2 ú
+A8B3 ǔ
+A8B4 ù
+A8B5 ǖ
+A8B6 ǘ
+A8B7 ǚ
+A8B8 ǜ
+A8B9 Ì
+A8BA ê
+A8BD ń
+A8BE ň
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_ldml.result b/mysql-test/r/ctype_ldml.result
index d5585dcfad9..3373e31539f 100644
--- a/mysql-test/r/ctype_ldml.result
+++ b/mysql-test/r/ctype_ldml.result
@@ -1,11 +1,43 @@
drop table if exists t1;
+In the following tests we change the order of letter "b"
+making it equal to letter "a", and check that it works
+with all Unicode character sets
set names utf8;
show variables like 'character_sets_dir%';
Variable_name Value
character_sets_dir MYSQL_TEST_DIR/std_data/
+show collation like 'utf8_phone_ci';
+Collation Charset Id Default Compiled Sortlen
+utf8_phone_ci utf8 352 8
+CREATE TABLE t1 (
+name VARCHAR(64),
+phone VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_phone_ci
+);
+INSERT INTO t1 VALUES ('Svoj','+7 912 800 80 02');
+INSERT INTO t1 VALUES ('Hf','+7 (912) 800 80 04');
+INSERT INTO t1 VALUES ('Bar','+7-912-800-80-01');
+INSERT INTO t1 VALUES ('Ramil','(7912) 800 80 03');
+INSERT INTO t1 VALUES ('Sanja','+380 (912) 8008005');
+SELECT * FROM t1 ORDER BY phone;
+name phone
+Sanja +380 (912) 8008005
+Bar +7-912-800-80-01
+Svoj +7 912 800 80 02
+Ramil (7912) 800 80 03
+Hf +7 (912) 800 80 04
+SELECT * FROM t1 WHERE phone='+7(912)800-80-01';
+name phone
+Bar +7-912-800-80-01
+SELECT * FROM t1 WHERE phone='79128008001';
+name phone
+Bar +7-912-800-80-01
+SELECT * FROM t1 WHERE phone='7 9 1 2 8 0 0 8 0 0 1';
+name phone
+Bar +7-912-800-80-01
+DROP TABLE t1;
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 +46,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 +88,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 +370,40 @@ 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_phone_ci utf8 352 8
+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;
+SET NAMES utf8 COLLATE utf8_phone_ci;
+SHOW COLLATION LIKE 'utf8_phone_ci';
+Collation Charset Id Default Compiled Sortlen
+utf8_phone_ci utf8 352 8
+SET NAMES utf8;
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_sjis.result b/mysql-test/r/ctype_sjis.result
index 1469e335f23..f450dd0488d 100644
--- a/mysql-test/r/ctype_sjis.result
+++ b/mysql-test/r/ctype_sjis.result
@@ -219,3 +219,290 @@ hex(a) hex(lower(a)) hex(upper(a))
8372835E 8372835E 8372835E
DROP TABLE t1;
# End of 5.1 tests
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=sjis_japanese_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS
+SELECT concat(head, tail) AS code, ' ' AS a
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN 'A1' AND 'DF')
+AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+INSERT t1 (code) SELECT head FROM head WHERE (head BETWEEN 'A1' AND 'DF');
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(8) DEFAULT NULL,
+ `a` varchar(1) CHARACTER SET sjis NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+14623
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=1;
+COUNT(*)
+63
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
+COUNT(*)
+11280
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a)
+FROM t1
+WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a))
+ORDER BY code;
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+8260 8260 8281   
+8261 8261 8282   
+8262 8262 8283   
+8263 8263 8284   
+8264 8264 8285   
+8265 8265 8286   
+8266 8266 8287   
+8267 8267 8288   
+8268 8268 8289   
+8269 8269 828A   
+826A 826A 828B   
+826B 826B 828C   
+826C 826C 828D   
+826D 826D 828E   
+826E 826E 828F   
+826F 826F 8290   
+8270 8270 8291   
+8271 8271 8292   
+8272 8272 8293   
+8273 8273 8294   
+8274 8274 8295   
+8275 8275 8296   
+8276 8276 8297   
+8277 8277 8298   
+8278 8278 8299   
+8279 8279 829A   
+8281 8260 8281   
+8282 8261 8282   
+8283 8262 8283   
+8284 8263 8284   
+8285 8264 8285   
+8286 8265 8286   
+8287 8266 8287   
+8288 8267 8288   
+8289 8268 8289   
+828A 8269 828A   
+828B 826A 828B   
+828C 826B 828C   
+828D 826C 828D   
+828E 826D 828E   
+828F 826E 828F   
+8290 826F 8290   
+8291 8270 8291   
+8292 8271 8292   
+8293 8272 8293   
+8294 8273 8294   
+8295 8274 8295   
+8296 8275 8296   
+8297 8276 8297   
+8298 8277 8298   
+8299 8278 8299   
+829A 8279 829A   
+839F 839F 83BF Α Α α
+83A0 83A0 83C0 Β Β β
+83A1 83A1 83C1 Γ Γ γ
+83A2 83A2 83C2 Δ Δ ή
+83A3 83A3 83C3 Ε Ε ε
+83A4 83A4 83C4 Ζ Ζ ζ
+83A5 83A5 83C5 Η Η η
+83A6 83A6 83C6 Θ Θ Ξ
+83A7 83A7 83C7 Ι Ι ι
+83A8 83A8 83C8 Κ Κ κ
+83A9 83A9 83C9 Λ Λ λ
+83AA 83AA 83CA Μ Μ ÎŒ
+83AB 83AB 83CB Ν Ν Μ
+83AC 83AC 83CC Ξ Ξ Ο
+83AD 83AD 83CD Ο Ο ο
+83AE 83AE 83CE Π Π π
+83AF 83AF 83CF Ρ Ρ ρ
+83B0 83B0 83D0 Σ Σ σ
+83B1 83B1 83D1 ΀ ΀ τ
+83B2 83B2 83D2 Υ Υ υ
+83B3 83B3 83D3 Ί Ί φ
+83B4 83B4 83D4 Χ Χ χ
+83B5 83B5 83D5 Κ Κ ψ
+83B6 83B6 83D6 Ω Ω ω
+83BF 839F 83BF α Α α
+83C0 83A0 83C0 β Β β
+83C1 83A1 83C1 γ Γ γ
+83C2 83A2 83C2 ή Δ ή
+83C3 83A3 83C3 ε Ε ε
+83C4 83A4 83C4 ζ Ζ ζ
+83C5 83A5 83C5 η Η η
+83C6 83A6 83C6 Ξ Θ Ξ
+83C7 83A7 83C7 ι Ι ι
+83C8 83A8 83C8 κ Κ κ
+83C9 83A9 83C9 λ Λ λ
+83CA 83AA 83CA ÎŒ Μ ÎŒ
+83CB 83AB 83CB Μ Ν Μ
+83CC 83AC 83CC Ο Ξ Ο
+83CD 83AD 83CD ο Ο ο
+83CE 83AE 83CE π Π π
+83CF 83AF 83CF ρ Ρ ρ
+83D0 83B0 83D0 σ Σ σ
+83D1 83B1 83D1 τ ΀ τ
+83D2 83B2 83D2 υ Υ υ
+83D3 83B3 83D3 φ Ί φ
+83D4 83B4 83D4 χ Χ χ
+83D5 83B5 83D5 ψ Κ ψ
+83D6 83B6 83D6 ω Ω ω
+8440 8440 8470 А А а
+8441 8441 8471 Б Б б
+8442 8442 8472 В В в
+8443 8443 8473 Г Г г
+8444 8444 8474 Д Д ÐŽ
+8445 8445 8475 Е Е е
+8446 8446 8476 Ё Ё ё
+8447 8447 8477 Ж Ж ж
+8448 8448 8478 З З з
+8449 8449 8479 И И О
+844A 844A 847A Й Й й
+844B 844B 847B К К к
+844C 844C 847C Л Л л
+844D 844D 847D М М ÐŒ
+844E 844E 847E Н Н М
+844F 844F 8480 О О П
+8450 8450 8481 П П п
+8451 8451 8482 Р Р р
+8452 8452 8483 С С с
+8453 8453 8484 Т Т т
+8454 8454 8485 У У у
+8455 8455 8486 Ѐ Ѐ ф
+8456 8456 8487 Х Х х
+8457 8457 8488 Њ Њ ц
+8458 8458 8489 Ч Ч ч
+8459 8459 848A К К ш
+845A 845A 848B Щ Щ щ
+845B 845B 848C Ъ Ъ ъ
+845C 845C 848D Ы Ы ы
+845D 845D 848E Ь Ь ь
+845E 845E 848F Э Э э
+845F 845F 8490 Ю Ю ю
+8460 8460 8491 Я Я я
+8470 8440 8470 а А а
+8471 8441 8471 б Б б
+8472 8442 8472 в В в
+8473 8443 8473 г Г г
+8474 8444 8474 ÐŽ Д ÐŽ
+8475 8445 8475 е Е е
+8476 8446 8476 ё Ё ё
+8477 8447 8477 ж Ж ж
+8478 8448 8478 з З з
+8479 8449 8479 О И О
+847A 844A 847A й Й й
+847B 844B 847B к К к
+847C 844C 847C л Л л
+847D 844D 847D ÐŒ М ÐŒ
+847E 844E 847E М Н М
+8480 844F 8480 П О П
+8481 8450 8481 п П п
+8482 8451 8482 р Р р
+8483 8452 8483 с С с
+8484 8453 8484 т Т т
+8485 8454 8485 у У у
+8486 8455 8486 ф Ѐ ф
+8487 8456 8487 х Х х
+8488 8457 8488 ц Њ ц
+8489 8458 8489 ч Ч ч
+848A 8459 848A ш К ш
+848B 845A 848B щ Щ щ
+848C 845B 848C ъ Ъ ъ
+848D 845C 848D ы Ы ы
+848E 845D 848E ь Ь ь
+848F 845E 848F э Э э
+8490 845F 8490 ю Ю ю
+8491 8460 8491 я Я я
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+81F0 Å
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
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_ujis.result b/mysql-test/r/ctype_ujis.result
index 540ba178756..1c4cfcd6ec5 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -2377,3 +2377,535 @@ DROP TABLE t2;
set names default;
set character_set_database=default;
set character_set_server=default;
+#
+# Start of 5.5 tests
+#
+#
+# Testing WL#4583 Case conversion in Asian character sets
+#
+SET NAMES utf8;
+SET collation_connection=ujis_japanese_ci;
+CREATE TABLE t1 (b VARCHAR(2));
+INSERT INTO t1 VALUES ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7');
+INSERT INTO t1 VALUES ('8'),('9'),('A'),('B'),('C'),('D'),('E'),('F');
+CREATE TEMPORARY TABLE head AS SELECT concat(b1.b, b2.b) AS head FROM t1 b1, t1 b2;
+CREATE TEMPORARY TABLE tail AS SELECT concat(b1.b, b2.b) AS tail FROM t1 b1, t1 b2;
+DROP TABLE t1;
+CREATE TABLE t1 AS SELECT 'XXXXXX' AS code, ' ' AS a LIMIT 0;
+INSERT INTO t1 (code) SELECT concat('8E', head) FROM head
+WHERE (head BETWEEN 'A1' AND 'DF') ORDER BY head;
+INSERT INTO t1 (code) SELECT concat(head, tail)
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (head NOT BETWEEN '8E' AND '8F')
+AND (tail BETWEEN '20' AND 'FF')
+ORDER BY head, tail;
+INSERT INTO t1 (code) SELECT concat('8F', head, tail)
+FROM head, tail
+WHERE (head BETWEEN '80' AND 'FF') AND (tail BETWEEN '80' AND 'FF')
+ORDER BY head, tail;
+DROP TEMPORARY TABLE head, tail;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `code` varchar(6) CHARACTER SET ujis NOT NULL DEFAULT '',
+ `a` varchar(1) CHARACTER SET ujis NOT NULL DEFAULT ''
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+UPDATE t1 SET a=unhex(code) ORDER BY code;
+Warnings:
+Warning 1366 Incorrect string value: '\x80 ' for column 'a' at row 1
+Warning 1366 Incorrect string value: '\x80!' for column 'a' at row 2
+Warning 1366 Incorrect string value: '\x80"' for column 'a' at row 3
+Warning 1366 Incorrect string value: '\x80#' for column 'a' at row 4
+Warning 1366 Incorrect string value: '\x80$' for column 'a' at row 5
+Warning 1366 Incorrect string value: '\x80%' for column 'a' at row 6
+Warning 1366 Incorrect string value: '\x80&' for column 'a' at row 7
+Warning 1366 Incorrect string value: '\x80'' for column 'a' at row 8
+Warning 1366 Incorrect string value: '\x80(' for column 'a' at row 9
+Warning 1366 Incorrect string value: '\x80)' for column 'a' at row 10
+Warning 1366 Incorrect string value: '\x80*' for column 'a' at row 11
+Warning 1366 Incorrect string value: '\x80+' for column 'a' at row 12
+Warning 1366 Incorrect string value: '\x80,' for column 'a' at row 13
+Warning 1366 Incorrect string value: '\x80-' for column 'a' at row 14
+Warning 1366 Incorrect string value: '\x80.' for column 'a' at row 15
+Warning 1366 Incorrect string value: '\x80/' for column 'a' at row 16
+Warning 1366 Incorrect string value: '\x800' for column 'a' at row 17
+Warning 1366 Incorrect string value: '\x801' for column 'a' at row 18
+Warning 1366 Incorrect string value: '\x802' for column 'a' at row 19
+Warning 1366 Incorrect string value: '\x803' for column 'a' at row 20
+Warning 1366 Incorrect string value: '\x804' for column 'a' at row 21
+Warning 1366 Incorrect string value: '\x805' for column 'a' at row 22
+Warning 1366 Incorrect string value: '\x806' for column 'a' at row 23
+Warning 1366 Incorrect string value: '\x807' for column 'a' at row 24
+Warning 1366 Incorrect string value: '\x808' for column 'a' at row 25
+Warning 1366 Incorrect string value: '\x809' for column 'a' at row 26
+Warning 1366 Incorrect string value: '\x80:' for column 'a' at row 27
+Warning 1366 Incorrect string value: '\x80;' for column 'a' at row 28
+Warning 1366 Incorrect string value: '\x80<' for column 'a' at row 29
+Warning 1366 Incorrect string value: '\x80=' for column 'a' at row 30
+Warning 1366 Incorrect string value: '\x80>' for column 'a' at row 31
+Warning 1366 Incorrect string value: '\x80?' for column 'a' at row 32
+Warning 1366 Incorrect string value: '\x80@' for column 'a' at row 33
+Warning 1366 Incorrect string value: '\x80A' for column 'a' at row 34
+Warning 1366 Incorrect string value: '\x80B' for column 'a' at row 35
+Warning 1366 Incorrect string value: '\x80C' for column 'a' at row 36
+Warning 1366 Incorrect string value: '\x80D' for column 'a' at row 37
+Warning 1366 Incorrect string value: '\x80E' for column 'a' at row 38
+Warning 1366 Incorrect string value: '\x80F' for column 'a' at row 39
+Warning 1366 Incorrect string value: '\x80G' for column 'a' at row 40
+Warning 1366 Incorrect string value: '\x80H' for column 'a' at row 41
+Warning 1366 Incorrect string value: '\x80I' for column 'a' at row 42
+Warning 1366 Incorrect string value: '\x80J' for column 'a' at row 43
+Warning 1366 Incorrect string value: '\x80K' for column 'a' at row 44
+Warning 1366 Incorrect string value: '\x80L' for column 'a' at row 45
+Warning 1366 Incorrect string value: '\x80M' for column 'a' at row 46
+Warning 1366 Incorrect string value: '\x80N' for column 'a' at row 47
+Warning 1366 Incorrect string value: '\x80O' for column 'a' at row 48
+Warning 1366 Incorrect string value: '\x80P' for column 'a' at row 49
+Warning 1366 Incorrect string value: '\x80Q' for column 'a' at row 50
+Warning 1366 Incorrect string value: '\x80R' for column 'a' at row 51
+Warning 1366 Incorrect string value: '\x80S' for column 'a' at row 52
+Warning 1366 Incorrect string value: '\x80T' for column 'a' at row 53
+Warning 1366 Incorrect string value: '\x80U' for column 'a' at row 54
+Warning 1366 Incorrect string value: '\x80V' for column 'a' at row 55
+Warning 1366 Incorrect string value: '\x80W' for column 'a' at row 56
+Warning 1366 Incorrect string value: '\x80X' for column 'a' at row 57
+Warning 1366 Incorrect string value: '\x80Y' for column 'a' at row 58
+Warning 1366 Incorrect string value: '\x80Z' for column 'a' at row 59
+Warning 1366 Incorrect string value: '\x80[' for column 'a' at row 60
+Warning 1366 Incorrect string value: '\x80\' for column 'a' at row 61
+Warning 1366 Incorrect string value: '\x80]' for column 'a' at row 62
+Warning 1366 Incorrect string value: '\x80^' for column 'a' at row 63
+Warning 1366 Incorrect string value: '\x80_' for column 'a' at row 64
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+44671
+SELECT COUNT(*) FROM t1 WHERE a<>'';
+COUNT(*)
+17735
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=2;
+COUNT(*)
+8899
+SELECT COUNT(*) FROM t1 WHERE a<>'' AND OCTET_LENGTH(a)=3;
+COUNT(*)
+8836
+SELECT code, hex(upper(a)), hex(lower(a)),a, upper(a), lower(a) FROM t1 WHERE hex(a)<>hex(upper(a)) OR hex(a)<>hex(lower(a)) ORDER BY code;
+code hex(upper(a)) hex(lower(a)) a upper(a) lower(a)
+8FA6E1 8FA6E1 8FA6F1 Ά Ά ά
+8FA6E2 8FA6E2 8FA6F2 Έ Έ έ
+8FA6E3 8FA6E3 8FA6F3 Ή Ή ή
+8FA6E4 8FA6E4 8FA6F4 Ί Ί ί
+8FA6E5 8FA6E5 8FA6F5 Ϊ Ϊ ϊ
+8FA6E7 8FA6E7 8FA6F7 Ό Ό ό
+8FA6E9 8FA6E9 8FA6F9 Ύ Ύ ύ
+8FA6EA 8FA6EA 8FA6FA Ϋ Ϋ ϋ
+8FA6EC 8FA6EC 8FA6FC Ώ Ώ ώ
+8FA6F1 8FA6E1 8FA6F1 ά Ά ά
+8FA6F2 8FA6E2 8FA6F2 έ Έ έ
+8FA6F3 8FA6E3 8FA6F3 ή Ή ή
+8FA6F4 8FA6E4 8FA6F4 ί Ί ί
+8FA6F5 8FA6E5 8FA6F5 ϊ Ϊ ϊ
+8FA6F7 8FA6E7 8FA6F7 ό Ό ό
+8FA6F8 A6B2 8FA6F8 ς Σ ς
+8FA6F9 8FA6E9 8FA6F9 ύ Ύ ύ
+8FA6FA 8FA6EA 8FA6FA ϋ Ϋ ϋ
+8FA6FC 8FA6EC 8FA6FC ώ Ώ ώ
+8FA7C2 8FA7C2 8FA7F2 Ђ Ђ ђ
+8FA7C3 8FA7C3 8FA7F3 Ѓ Ѓ ѓ
+8FA7C4 8FA7C4 8FA7F4 Є Є є
+8FA7C5 8FA7C5 8FA7F5 Ѕ Ѕ ѕ
+8FA7C6 8FA7C6 8FA7F6 І І і
+8FA7C7 8FA7C7 8FA7F7 Ї Ї ї
+8FA7C8 8FA7C8 8FA7F8 Ј Ј ј
+8FA7C9 8FA7C9 8FA7F9 Љ Љ љ
+8FA7CA 8FA7CA 8FA7FA Њ Њ њ
+8FA7CB 8FA7CB 8FA7FB Ћ Ћ ћ
+8FA7CC 8FA7CC 8FA7FC Ќ Ќ ќ
+8FA7CD 8FA7CD 8FA7FD Ў Ў ў
+8FA7CE 8FA7CE 8FA7FE Џ Џ џ
+8FA7F2 8FA7C2 8FA7F2 ђ Ђ ђ
+8FA7F3 8FA7C3 8FA7F3 ѓ Ѓ ѓ
+8FA7F4 8FA7C4 8FA7F4 є Є є
+8FA7F5 8FA7C5 8FA7F5 ѕ Ѕ ѕ
+8FA7F6 8FA7C6 8FA7F6 і І і
+8FA7F7 8FA7C7 8FA7F7 ї Ї ї
+8FA7F8 8FA7C8 8FA7F8 ј Ј ј
+8FA7F9 8FA7C9 8FA7F9 љ Љ љ
+8FA7FA 8FA7CA 8FA7FA њ Њ њ
+8FA7FB 8FA7CB 8FA7FB ћ Ћ ћ
+8FA7FC 8FA7CC 8FA7FC ќ Ќ ќ
+8FA7FD 8FA7CD 8FA7FD ў Ў ў
+8FA7FE 8FA7CE 8FA7FE џ Џ џ
+8FA9A1 8FA9A1 8FA9C1 Æ Æ Ê
+8FA9A2 8FA9A2 8FA9C2 Đ Đ đ
+8FA9A4 8FA9A4 8FA9C4 Ċ Ċ ħ
+8FA9A6 8FA9A6 8FA9C6 IJ IJ ij
+8FA9A8 8FA9A8 8FA9C8 Ł Ł ł
+8FA9A9 8FA9A9 8FA9C9 Ŀ Ŀ ŀ
+8FA9AB 8FA9AB 8FA9CB Ŋ Ŋ ŋ
+8FA9AC 8FA9AC 8FA9CC Ø Ø Þ
+8FA9AD 8FA9AD 8FA9CD Œ Œ œ
+8FA9AF 8FA9AF 8FA9CF Ŋ Ŋ ŧ
+8FA9B0 8FA9B0 8FA9D0 Þ Þ ß
+8FA9C1 8FA9A1 8FA9C1 Ê Æ Ê
+8FA9C2 8FA9A2 8FA9C2 đ Đ đ
+8FA9C4 8FA9A4 8FA9C4 ħ Ċ ħ
+8FA9C5 49 8FA9C5 ı I ı
+8FA9C6 8FA9A6 8FA9C6 ij IJ ij
+8FA9C8 8FA9A8 8FA9C8 ł Ł ł
+8FA9C9 8FA9A9 8FA9C9 ŀ Ŀ ŀ
+8FA9CB 8FA9AB 8FA9CB ŋ Ŋ ŋ
+8FA9CC 8FA9AC 8FA9CC Þ Ø Þ
+8FA9CD 8FA9AD 8FA9CD œ Œ œ
+8FA9CF 8FA9AF 8FA9CF ŧ Ŋ ŧ
+8FA9D0 8FA9B0 8FA9D0 ß Þ ß
+8FAAA1 8FAAA1 8FABA1 Á Á á
+8FAAA2 8FAAA2 8FABA2 À À à
+8FAAA3 8FAAA3 8FABA3 Ä Ä À
+8FAAA4 8FAAA4 8FABA4 Â Â â
+8FAAA5 8FAAA5 8FABA5 Ă Ă ă
+8FAAA6 8FAAA6 8FABA6 Ǎ Ǎ ǎ
+8FAAA7 8FAAA7 8FABA7 Ā Ā ā
+8FAAA8 8FAAA8 8FABA8 Ą Ą ą
+8FAAA9 8FAAA9 8FABA9 Å Å å
+8FAAAA 8FAAAA 8FABAA Ã Ã ã
+8FAAAB 8FAAAB 8FABAB Ć Ć ć
+8FAAAC 8FAAAC 8FABAC Ĉ Ĉ ĉ
+8FAAAD 8FAAAD 8FABAD Č Č č
+8FAAAE 8FAAAE 8FABAE Ç Ç ç
+8FAAAF 8FAAAF 8FABAF Ċ Ċ ċ
+8FAAB0 8FAAB0 8FABB0 Ď Ď ď
+8FAAB1 8FAAB1 8FABB1 É É é
+8FAAB2 8FAAB2 8FABB2 È È Ú
+8FAAB3 8FAAB3 8FABB3 Ë Ë ë
+8FAAB4 8FAAB4 8FABB4 Ê Ê ê
+8FAAB5 8FAAB5 8FABB5 Ě Ě ě
+8FAAB6 8FAAB6 8FABB6 Ė Ė ė
+8FAAB7 8FAAB7 8FABB7 Ē Ē ē
+8FAAB8 8FAAB8 8FABB8 Ę Ę ę
+8FAABA 8FAABA 8FABBA Ĝ Ĝ ĝ
+8FAABB 8FAABB 8FABBB Ğ Ğ ğ
+8FAABD 8FAABD 8FABBD Ä  Ä  Ä¡
+8FAABE 8FAABE 8FABBE Ā Ā ĥ
+8FAABF 8FAABF 8FABBF Í Í í
+8FAAC0 8FAAC0 8FABC0 Ì Ì ì
+8FAAC1 8FAAC1 8FABC1 Ï Ï ï
+8FAAC2 8FAAC2 8FABC2 Î Î î
+8FAAC3 8FAAC3 8FABC3 Ǐ Ǐ ǐ
+8FAAC4 8FAAC4 69 İ İ i
+8FAAC5 8FAAC5 8FABC5 Ī Ī ī
+8FAAC6 8FAAC6 8FABC6 Į Į į
+8FAAC7 8FAAC7 8FABC7 Äš Äš Ä©
+8FAAC8 8FAAC8 8FABC8 Ď Ď ĵ
+8FAAC9 8FAAC9 8FABC9 Ķ Ķ ķ
+8FAACA 8FAACA 8FABCA Ĺ Ĺ ĺ
+8FAACB 8FAACB 8FABCB Ĝ Ĝ ğ
+8FAACC 8FAACC 8FABCC Ļ Ļ Č
+8FAACD 8FAACD 8FABCD Ń Ń ń
+8FAACE 8FAACE 8FABCE Ň Ň ň
+8FAACF 8FAACF 8FABCF Ņ Ņ ņ
+8FAAD0 8FAAD0 8FABD0 Ñ Ñ ñ
+8FAAD1 8FAAD1 8FABD1 Ó Ó ó
+8FAAD2 8FAAD2 8FABD2 Ò Ò ò
+8FAAD3 8FAAD3 8FABD3 Ö Ö ö
+8FAAD4 8FAAD4 8FABD4 Ô Ô ÃŽ
+8FAAD5 8FAAD5 8FABD5 Ǒ Ǒ ǒ
+8FAAD6 8FAAD6 8FABD6 Ő Ő ő
+8FAAD7 8FAAD7 8FABD7 Ō Ō ō
+8FAAD8 8FAAD8 8FABD8 Õ Õ õ
+8FAAD9 8FAAD9 8FABD9 Ŕ Ŕ ŕ
+8FAADA 8FAADA 8FABDA Ř Ř ř
+8FAADB 8FAADB 8FABDB Ŗ Ŗ ŗ
+8FAADC 8FAADC 8FABDC Ś Ś ś
+8FAADD 8FAADD 8FABDD Ŝ Ŝ ŝ
+8FAADE 8FAADE 8FABDE Å  Å  Å¡
+8FAADF 8FAADF 8FABDF Ş Ş ş
+8FAAE0 8FAAE0 8FABE0 ŀ ŀ ť
+8FAAE1 8FAAE1 8FABE1 Ţ Ţ ţ
+8FAAE2 8FAAE2 8FABE2 Ú Ú ú
+8FAAE3 8FAAE3 8FABE3 Ù Ù ù
+8FAAE4 8FAAE4 8FABE4 Ü Ü ÃŒ
+8FAAE5 8FAAE5 8FABE5 Û Û û
+8FAAE6 8FAAE6 8FABE6 Ŭ Ŭ ŭ
+8FAAE7 8FAAE7 8FABE7 Ǔ Ǔ ǔ
+8FAAE8 8FAAE8 8FABE8 Ű Ű ű
+8FAAE9 8FAAE9 8FABE9 Ū Ū ū
+8FAAEA 8FAAEA 8FABEA Ų Ų ų
+8FAAEB 8FAAEB 8FABEB Ů Ů ů
+8FAAEC 8FAAEC 8FABEC Åš Åš Å©
+8FAAED 8FAAED 8FABED Ǘ Ǘ ǘ
+8FAAEE 8FAAEE 8FABEE Ǜ Ǜ ǜ
+8FAAEF 8FAAEF 8FABEF Ǚ Ǚ ǚ
+8FAAF0 8FAAF0 8FABF0 Ǖ Ǖ ǖ
+8FAAF1 8FAAF1 8FABF1 Ŏ Ŏ ŵ
+8FAAF2 8FAAF2 8FABF2 Ý Ý Ü
+8FAAF3 8FAAF3 8FABF3 Ş Ş ÿ
+8FAAF4 8FAAF4 8FABF4 Ŷ Ŷ ŷ
+8FAAF5 8FAAF5 8FABF5 Ź Ź ź
+8FAAF6 8FAAF6 8FABF6 Ŝ Ŝ ş
+8FAAF7 8FAAF7 8FABF7 Ż Ż Ō
+8FABA1 8FAAA1 8FABA1 á Á á
+8FABA2 8FAAA2 8FABA2 à À à
+8FABA3 8FAAA3 8FABA3 À Ä À
+8FABA4 8FAAA4 8FABA4 â Â â
+8FABA5 8FAAA5 8FABA5 ă Ă ă
+8FABA6 8FAAA6 8FABA6 ǎ Ǎ ǎ
+8FABA7 8FAAA7 8FABA7 ā Ā ā
+8FABA8 8FAAA8 8FABA8 ą Ą ą
+8FABA9 8FAAA9 8FABA9 å Å å
+8FABAA 8FAAAA 8FABAA ã Ã ã
+8FABAB 8FAAAB 8FABAB ć Ć ć
+8FABAC 8FAAAC 8FABAC ĉ Ĉ ĉ
+8FABAD 8FAAAD 8FABAD č Č č
+8FABAE 8FAAAE 8FABAE ç Ç ç
+8FABAF 8FAAAF 8FABAF ċ Ċ ċ
+8FABB0 8FAAB0 8FABB0 ď Ď ď
+8FABB1 8FAAB1 8FABB1 é É é
+8FABB2 8FAAB2 8FABB2 Ú È Ú
+8FABB3 8FAAB3 8FABB3 ë Ë ë
+8FABB4 8FAAB4 8FABB4 ê Ê ê
+8FABB5 8FAAB5 8FABB5 ě Ě ě
+8FABB6 8FAAB6 8FABB6 ė Ė ė
+8FABB7 8FAAB7 8FABB7 ē Ē ē
+8FABB8 8FAAB8 8FABB8 ę Ę ę
+8FABBA 8FAABA 8FABBA ĝ Ĝ ĝ
+8FABBB 8FAABB 8FABBB ğ Ğ ğ
+8FABBD 8FAABD 8FABBD Ä¡ Ä  Ä¡
+8FABBE 8FAABE 8FABBE ĥ Ā ĥ
+8FABBF 8FAABF 8FABBF í Í í
+8FABC0 8FAAC0 8FABC0 ì Ì ì
+8FABC1 8FAAC1 8FABC1 ï Ï ï
+8FABC2 8FAAC2 8FABC2 î Î î
+8FABC3 8FAAC3 8FABC3 ǐ Ǐ ǐ
+8FABC5 8FAAC5 8FABC5 ī Ī ī
+8FABC6 8FAAC6 8FABC6 į Į į
+8FABC7 8FAAC7 8FABC7 Ä© Äš Ä©
+8FABC8 8FAAC8 8FABC8 ĵ Ď ĵ
+8FABC9 8FAAC9 8FABC9 ķ Ķ ķ
+8FABCA 8FAACA 8FABCA ĺ Ĺ ĺ
+8FABCB 8FAACB 8FABCB ğ Ĝ ğ
+8FABCC 8FAACC 8FABCC Č Ļ Č
+8FABCD 8FAACD 8FABCD ń Ń ń
+8FABCE 8FAACE 8FABCE ň Ň ň
+8FABCF 8FAACF 8FABCF ņ Ņ ņ
+8FABD0 8FAAD0 8FABD0 ñ Ñ ñ
+8FABD1 8FAAD1 8FABD1 ó Ó ó
+8FABD2 8FAAD2 8FABD2 ò Ò ò
+8FABD3 8FAAD3 8FABD3 ö Ö ö
+8FABD4 8FAAD4 8FABD4 ÃŽ Ô ÃŽ
+8FABD5 8FAAD5 8FABD5 ǒ Ǒ ǒ
+8FABD6 8FAAD6 8FABD6 ő Ő ő
+8FABD7 8FAAD7 8FABD7 ō Ō ō
+8FABD8 8FAAD8 8FABD8 õ Õ õ
+8FABD9 8FAAD9 8FABD9 ŕ Ŕ ŕ
+8FABDA 8FAADA 8FABDA ř Ř ř
+8FABDB 8FAADB 8FABDB ŗ Ŗ ŗ
+8FABDC 8FAADC 8FABDC ś Ś ś
+8FABDD 8FAADD 8FABDD ŝ Ŝ ŝ
+8FABDE 8FAADE 8FABDE Å¡ Å  Å¡
+8FABDF 8FAADF 8FABDF ş Ş ş
+8FABE0 8FAAE0 8FABE0 ť ŀ ť
+8FABE1 8FAAE1 8FABE1 ţ Ţ ţ
+8FABE2 8FAAE2 8FABE2 ú Ú ú
+8FABE3 8FAAE3 8FABE3 ù Ù ù
+8FABE4 8FAAE4 8FABE4 ÃŒ Ü ÃŒ
+8FABE5 8FAAE5 8FABE5 û Û û
+8FABE6 8FAAE6 8FABE6 ŭ Ŭ ŭ
+8FABE7 8FAAE7 8FABE7 ǔ Ǔ ǔ
+8FABE8 8FAAE8 8FABE8 ű Ű ű
+8FABE9 8FAAE9 8FABE9 ū Ū ū
+8FABEA 8FAAEA 8FABEA ų Ų ų
+8FABEB 8FAAEB 8FABEB ů Ů ů
+8FABEC 8FAAEC 8FABEC Å© Åš Å©
+8FABED 8FAAED 8FABED ǘ Ǘ ǘ
+8FABEE 8FAAEE 8FABEE ǜ Ǜ ǜ
+8FABEF 8FAAEF 8FABEF ǚ Ǚ ǚ
+8FABF0 8FAAF0 8FABF0 ǖ Ǖ ǖ
+8FABF1 8FAAF1 8FABF1 ŵ Ŏ ŵ
+8FABF2 8FAAF2 8FABF2 Ü Ý Ü
+8FABF3 8FAAF3 8FABF3 ÿ Ş ÿ
+8FABF4 8FAAF4 8FABF4 ŷ Ŷ ŷ
+8FABF5 8FAAF5 8FABF5 ź Ź ź
+8FABF6 8FAAF6 8FABF6 ş Ŝ ş
+8FABF7 8FAAF7 8FABF7 Ō Ż Ō
+A2F2 A2F2 8FABA9 Å Å å
+A3C1 A3C1 A3E1   
+A3C2 A3C2 A3E2   
+A3C3 A3C3 A3E3   
+A3C4 A3C4 A3E4   
+A3C5 A3C5 A3E5   
+A3C6 A3C6 A3E6   
+A3C7 A3C7 A3E7   
+A3C8 A3C8 A3E8   
+A3C9 A3C9 A3E9   
+A3CA A3CA A3EA   
+A3CB A3CB A3EB   
+A3CC A3CC A3EC   
+A3CD A3CD A3ED   
+A3CE A3CE A3EE   
+A3CF A3CF A3EF   
+A3D0 A3D0 A3F0   
+A3D1 A3D1 A3F1   
+A3D2 A3D2 A3F2   
+A3D3 A3D3 A3F3   
+A3D4 A3D4 A3F4   
+A3D5 A3D5 A3F5   
+A3D6 A3D6 A3F6   
+A3D7 A3D7 A3F7   
+A3D8 A3D8 A3F8   
+A3D9 A3D9 A3F9   
+A3DA A3DA A3FA   
+A3E1 A3C1 A3E1   
+A3E2 A3C2 A3E2   
+A3E3 A3C3 A3E3   
+A3E4 A3C4 A3E4   
+A3E5 A3C5 A3E5   
+A3E6 A3C6 A3E6   
+A3E7 A3C7 A3E7   
+A3E8 A3C8 A3E8   
+A3E9 A3C9 A3E9   
+A3EA A3CA A3EA   
+A3EB A3CB A3EB   
+A3EC A3CC A3EC   
+A3ED A3CD A3ED   
+A3EE A3CE A3EE   
+A3EF A3CF A3EF   
+A3F0 A3D0 A3F0   
+A3F1 A3D1 A3F1   
+A3F2 A3D2 A3F2   
+A3F3 A3D3 A3F3   
+A3F4 A3D4 A3F4   
+A3F5 A3D5 A3F5   
+A3F6 A3D6 A3F6   
+A3F7 A3D7 A3F7   
+A3F8 A3D8 A3F8   
+A3F9 A3D9 A3F9   
+A3FA A3DA A3FA   
+A6A1 A6A1 A6C1 Α Α α
+A6A2 A6A2 A6C2 Β Β β
+A6A3 A6A3 A6C3 Γ Γ γ
+A6A4 A6A4 A6C4 Δ Δ ή
+A6A5 A6A5 A6C5 Ε Ε ε
+A6A6 A6A6 A6C6 Ζ Ζ ζ
+A6A7 A6A7 A6C7 Η Η η
+A6A8 A6A8 A6C8 Θ Θ Ξ
+A6A9 A6A9 A6C9 Ι Ι ι
+A6AA A6AA A6CA Κ Κ κ
+A6AB A6AB A6CB Λ Λ λ
+A6AC A6AC A6CC Μ Μ ÎŒ
+A6AD A6AD A6CD Ν Ν Μ
+A6AE A6AE A6CE Ξ Ξ Ο
+A6AF A6AF A6CF Ο Ο ο
+A6B0 A6B0 A6D0 Π Π π
+A6B1 A6B1 A6D1 Ρ Ρ ρ
+A6B2 A6B2 A6D2 Σ Σ σ
+A6B3 A6B3 A6D3 ΀ ΀ τ
+A6B4 A6B4 A6D4 Υ Υ υ
+A6B5 A6B5 A6D5 Ί Ί φ
+A6B6 A6B6 A6D6 Χ Χ χ
+A6B7 A6B7 A6D7 Κ Κ ψ
+A6B8 A6B8 A6D8 Ω Ω ω
+A6C1 A6A1 A6C1 α Α α
+A6C2 A6A2 A6C2 β Β β
+A6C3 A6A3 A6C3 γ Γ γ
+A6C4 A6A4 A6C4 ή Δ ή
+A6C5 A6A5 A6C5 ε Ε ε
+A6C6 A6A6 A6C6 ζ Ζ ζ
+A6C7 A6A7 A6C7 η Η η
+A6C8 A6A8 A6C8 Ξ Θ Ξ
+A6C9 A6A9 A6C9 ι Ι ι
+A6CA A6AA A6CA κ Κ κ
+A6CB A6AB A6CB λ Λ λ
+A6CC A6AC A6CC ÎŒ Μ ÎŒ
+A6CD A6AD A6CD Μ Ν Μ
+A6CE A6AE A6CE Ο Ξ Ο
+A6CF A6AF A6CF ο Ο ο
+A6D0 A6B0 A6D0 π Π π
+A6D1 A6B1 A6D1 ρ Ρ ρ
+A6D2 A6B2 A6D2 σ Σ σ
+A6D3 A6B3 A6D3 τ ΀ τ
+A6D4 A6B4 A6D4 υ Υ υ
+A6D5 A6B5 A6D5 φ Ί φ
+A6D6 A6B6 A6D6 χ Χ χ
+A6D7 A6B7 A6D7 ψ Κ ψ
+A6D8 A6B8 A6D8 ω Ω ω
+A7A1 A7A1 A7D1 А А а
+A7A2 A7A2 A7D2 Б Б б
+A7A3 A7A3 A7D3 В В в
+A7A4 A7A4 A7D4 Г Г г
+A7A5 A7A5 A7D5 Д Д ÐŽ
+A7A6 A7A6 A7D6 Е Е е
+A7A7 A7A7 A7D7 Ё Ё ё
+A7A8 A7A8 A7D8 Ж Ж ж
+A7A9 A7A9 A7D9 З З з
+A7AA A7AA A7DA И И О
+A7AB A7AB A7DB Й Й й
+A7AC A7AC A7DC К К к
+A7AD A7AD A7DD Л Л л
+A7AE A7AE A7DE М М ÐŒ
+A7AF A7AF A7DF Н Н М
+A7B0 A7B0 A7E0 О О П
+A7B1 A7B1 A7E1 П П п
+A7B2 A7B2 A7E2 Р Р р
+A7B3 A7B3 A7E3 С С с
+A7B4 A7B4 A7E4 Т Т т
+A7B5 A7B5 A7E5 У У у
+A7B6 A7B6 A7E6 Ѐ Ѐ ф
+A7B7 A7B7 A7E7 Х Х х
+A7B8 A7B8 A7E8 Њ Њ ц
+A7B9 A7B9 A7E9 Ч Ч ч
+A7BA A7BA A7EA К К ш
+A7BB A7BB A7EB Щ Щ щ
+A7BC A7BC A7EC Ъ Ъ ъ
+A7BD A7BD A7ED Ы Ы ы
+A7BE A7BE A7EE Ь Ь ь
+A7BF A7BF A7EF Э Э э
+A7C0 A7C0 A7F0 Ю Ю ю
+A7C1 A7C1 A7F1 Я Я я
+A7D1 A7A1 A7D1 а А а
+A7D2 A7A2 A7D2 б Б б
+A7D3 A7A3 A7D3 в В в
+A7D4 A7A4 A7D4 г Г г
+A7D5 A7A5 A7D5 ÐŽ Д ÐŽ
+A7D6 A7A6 A7D6 е Е е
+A7D7 A7A7 A7D7 ё Ё ё
+A7D8 A7A8 A7D8 ж Ж ж
+A7D9 A7A9 A7D9 з З з
+A7DA A7AA A7DA О И О
+A7DB A7AB A7DB й Й й
+A7DC A7AC A7DC к К к
+A7DD A7AD A7DD л Л л
+A7DE A7AE A7DE ÐŒ М ÐŒ
+A7DF A7AF A7DF М Н М
+A7E0 A7B0 A7E0 П О П
+A7E1 A7B1 A7E1 п П п
+A7E2 A7B2 A7E2 р Р р
+A7E3 A7B3 A7E3 с С с
+A7E4 A7B4 A7E4 т Т т
+A7E5 A7B5 A7E5 у У у
+A7E6 A7B6 A7E6 ф Ѐ ф
+A7E7 A7B7 A7E7 х Х х
+A7E8 A7B8 A7E8 ц Њ ц
+A7E9 A7B9 A7E9 ч Ч ч
+A7EA A7BA A7EA ш К ш
+A7EB A7BB A7EB щ Щ щ
+A7EC A7BC A7EC ъ Ъ ъ
+A7ED A7BD A7ED ы Ы ы
+A7EE A7BE A7EE ь Ь ь
+A7EF A7BF A7EF э Э э
+A7F0 A7C0 A7F0 ю Ю ю
+A7F1 A7C1 A7F1 я Я я
+SELECT * FROM t1
+WHERE HEX(CAST(LOWER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(LOWER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+8FAABC Ģ
+SELECT * FROM t1
+WHERE HEX(CAST(UPPER(a) AS CHAR CHARACTER SET utf8)) <>
+HEX(UPPER(CAST(a AS CHAR CHARACTER SET utf8))) ORDER BY code;
+code a
+8FA9C3 ð
+8FABB9 ǵ
+DROP TABLE t1;
+#
+# End of 5.5 tests
+#
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 4c21e66a39c..55c32c6a1d4 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');
@@ -1898,3 +1898,132 @@ CONVERT(a, CHAR) CONVERT(b, CHAR)
70000 1092
DROP TABLE t1;
End of 5.0 tests
+Start of 5.4 tests
+CREATE TABLE t1 (
+clipid INT NOT NULL,
+Tape TINYTEXT,
+PRIMARY KEY (clipid),
+KEY tape(Tape(255))
+) CHARACTER SET=utf8;
+ALTER TABLE t1 ADD mos TINYINT DEFAULT 0 AFTER clipid;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `clipid` int(11) NOT NULL,
+ `mos` tinyint(4) DEFAULT '0',
+ `Tape` tinytext,
+ PRIMARY KEY (`clipid`),
+ KEY `tape` (`Tape`(255))
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+DROP TABLE t1;
+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..432b9b14a85 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -15,71 +15,6 @@ variable_name variable_value
DATETIME_FORMAT %Y-%m-%d %H:%i:%s
DATE_FORMAT %d.%m.%Y
TIME_FORMAT %H.%i.%s
-SET time_format='%H%i%s';
-SET time_format='%H:%i:%s.%f';
-SET time_format='%h-%i-%s.%f%p';
-SET time_format='%h:%i:%s.%f %p';
-SET time_format='%h:%i:%s%p';
-SET date_format='%Y%m%d';
-SET date_format='%Y.%m.%d';
-SET date_format='%d.%m.%Y';
-SET date_format='%m-%d-%Y';
-set datetime_format= '%Y%m%d%H%i%s';
-set datetime_format= '%Y-%m-%d %H:%i:%s';
-set datetime_format= '%m-%d-%y %H:%i:%s.%f';
-set datetime_format= '%d-%m-%Y %h:%i:%s%p';
-set datetime_format= '%H:%i:%s %Y-%m-%d';
-set datetime_format= '%H:%i:%s.%f %m-%d-%Y';
-set datetime_format= '%h:%i:%s %p %Y-%m-%d';
-set datetime_format= '%h:%i:%s.%f %p %Y-%m-%d';
-SELECT variable_name, variable_value
-FROM information_schema.session_variables
-WHERE variable_name IN ('date_format', 'datetime_format', 'time_format')
-ORDER BY variable_name;
-variable_name variable_value
-DATETIME_FORMAT %h:%i:%s.%f %p %Y-%m-%d
-DATE_FORMAT %m-%d-%Y
-TIME_FORMAT %h:%i:%s%p
-SET time_format='%h:%i:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s'
-SET time_format='%H %i:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H %i:%s'
-SET time_format='%H::%i:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H::%i:%s'
-SET time_format='%H:%i:%s%f';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%f'
-SET time_format='%H:%i.%f:%s';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i.%f:%s'
-SET time_format='%H:%i:%s%p';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i:%s%p'
-SET time_format='%h:%i:%s.%f %p %Y-%m-%d';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%h:%i:%s.%f %p %Y-%m-%d'
-SET time_format='%H%i%s.%f';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H%i%s.%f'
-SET time_format='%H:%i-%s.%f';
-ERROR 42000: Variable 'time_format' can't be set to the value of '%H:%i-%s.%f'
-SET date_format='%d.%m.%d';
-ERROR 42000: Variable 'date_format' can't be set to the value of '%d.%m.%d'
-SET datetime_format='%h.%m.%y %d.%i.%s';
-ERROR 42000: Variable 'datetime_format' can't be set to the value of '%h.%m.%y %d.%i.%s'
-set datetime_format= '%H:%i:%s.%f %p %Y-%m-%d';
-ERROR 42000: Variable 'datetime_format' can't be set to the value of '%H:%i:%s.%f %p %Y-%m-%d'
-set GLOBAL datetime_format= '%H:%i:%s %Y-%m-%d';
-SET SESSION datetime_format=default;
-select @@global.datetime_format, @@session.datetime_format;
-@@global.datetime_format @@session.datetime_format
-%H:%i:%s %Y-%m-%d %H:%i:%s %Y-%m-%d
-SET GLOBAL datetime_format=default;
-SET SESSION datetime_format=default;
-select @@global.datetime_format, @@session.datetime_format;
-@@global.datetime_format @@session.datetime_format
-%Y-%m-%d %H:%i:%s %Y-%m-%d %H:%i:%s
-SET GLOBAL date_format=default;
-SET GLOBAL time_format=default;
-SET GLOBAL datetime_format=default;
-SET time_format=default;
-SET date_format=default;
-SET datetime_format=default;
select str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
str_to_date(concat('15-01-2001',' 2:59:58.999'),
@@ -89,7 +24,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 +296,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 +330,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 +384,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..2282f65c456 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|
@@ -361,8 +361,8 @@ 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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -379,8 +379,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -397,8 +397,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p3 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -415,8 +415,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p4 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -607,8 +607,8 @@ 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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -625,8 +625,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -643,8 +643,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p3 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -661,8 +661,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p4 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1009,8 +1009,8 @@ 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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1027,8 +1027,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1045,8 +1045,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p3 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE ÐÅÒÅÍ1 CHAR(10);
SELECT
COLLATION(ÐÅÒÅÍ1) AS c1,
@@ -1063,8 +1063,8 @@ SET ÐÁÒÁÍ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost koi8r koi8r_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p4 PROCEDURE NULL NULL NULL NULL NULL NULL 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..9d27fdb22bb 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|
@@ -361,8 +361,8 @@ 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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -379,8 +379,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -397,8 +397,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p3 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -415,8 +415,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p4 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -607,8 +607,8 @@ 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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -625,8 +625,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -643,8 +643,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p3 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -661,8 +661,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p4 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -1009,8 +1009,8 @@ 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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -1027,8 +1027,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest1 p2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10) CHARACTER SET utf8;
SELECT
COLLATION(переЌ1) AS c1,
@@ -1045,8 +1045,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p3 PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
DECLARE переЌ1 CHAR(10);
SELECT
COLLATION(переЌ1) AS c1,
@@ -1063,8 +1063,8 @@ SET параЌ2 = 'b';
END NULL NULL SQL NO CONTAINS SQL NULL DEFINER CREATED ALTERED root@localhost utf8 utf8_general_ci utf8_unicode_ci
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
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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 def mysqltest2 p4 PROCEDURE NULL NULL NULL NULL NULL NULL 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/delete.result b/mysql-test/r/delete.result
index 1df19a75854..c76937c7abd 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -259,8 +259,8 @@ ERROR 42S02: Unknown table 't2' in MULTI DELETE
DELETE FROM db1.t1 alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
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 'alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a' at line 1
DELETE FROM alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
-ERROR 42S02: Unknown table 'alias' in MULTI DELETE
DELETE FROM db2.alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
+ERROR 42S02: Unknown table 'alias' in MULTI DELETE
DELETE FROM t1 USING t1 WHERE a = 1;
SELECT * FROM t1;
a
@@ -279,6 +279,147 @@ ERROR 42000: Incorrect number of arguments for FUNCTION test.f1; expected 0, got
DROP TABLE t1;
DROP FUNCTION f1;
End of 5.0 tests
+DROP DATABASE IF EXISTS db1;
+DROP DATABASE IF EXISTS db2;
+DROP DATABASE IF EXISTS db3;
+DROP DATABASE IF EXISTS db4;
+DROP TABLE IF EXISTS t1, t2;
+DROP PROCEDURE IF EXISTS count;
+USE test;
+CREATE DATABASE db1;
+CREATE DATABASE db2;
+CREATE TABLE db1.t1 (a INT, b INT);
+INSERT INTO db1.t1 VALUES (1,1),(2,2),(3,3);
+CREATE TABLE db1.t2 AS SELECT * FROM db1.t1;
+CREATE TABLE db2.t1 AS SELECT * FROM db1.t2;
+CREATE TABLE db2.t2 AS SELECT * FROM db2.t1;
+CREATE TABLE t1 AS SELECT * FROM db2.t2;
+CREATE TABLE t2 AS SELECT * FROM t1;
+CREATE PROCEDURE count_rows()
+BEGIN
+SELECT COUNT(*) AS "COUNT(db1.t1)" FROM db1.t1;
+SELECT COUNT(*) AS "COUNT(db1.t2)" FROM db1.t2;
+SELECT COUNT(*) AS "COUNT(db2.t1)" FROM db2.t1;
+SELECT COUNT(*) AS "COUNT(db2.t2)" FROM db2.t2;
+SELECT COUNT(*) AS "COUNT(test.t1)" FROM test.t1;
+SELECT COUNT(*) AS "COUNT(test.t2)" FROM test.t2;
+END|
+CREATE DATABASE db3;
+USE db3;
+DROP DATABASE db3;
+SELECT * FROM t1;
+ERROR 3D000: No database selected
+DELETE a1,a2 FROM db1.t1, db2.t2;
+ERROR 3D000: No database selected
+DELETE a1,a2 FROM db1.t1, db2.t2;
+ERROR 3D000: No database selected
+DELETE a1,a2 FROM db1.t1 AS a1, db2.t2;
+ERROR 3D000: No database selected
+DELETE a1,a2 FROM db1.t1, db2.t2 AS a2;
+ERROR 3D000: No database selected
+DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
+ERROR 3D000: No database selected
+DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
+ERROR 3D000: No database selected
+DELETE FROM a1,a2 USING db1.t1, db2.t2;
+ERROR 3D000: No database selected
+DELETE FROM a1,a2 USING db1.t1, db2.t2;
+ERROR 3D000: No database selected
+DELETE FROM a1,a2 USING db1.t1 AS a1, db2.t2;
+ERROR 3D000: No database selected
+DELETE FROM a1,a2 USING db1.t1, db2.t2 AS a2;
+ERROR 3D000: No database selected
+DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
+ERROR 3D000: No database selected
+DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
+ERROR 3D000: No database selected
+DELETE a1 FROM db1.t1 AS a1, db2.t2 AS a1;
+ERROR 3D000: No database selected
+DELETE a1 FROM db1.a1, db2.t2 AS a1;
+ERROR 3D000: No database selected
+DELETE a1 FROM a1, db1.t1 AS a1;
+ERROR 3D000: No database selected
+DELETE t1 FROM db1.t1, db2.t1 AS a1;
+ERROR 3D000: No database selected
+DELETE t1 FROM db1.t1 AS a1, db2.t1 AS a2;
+ERROR 3D000: No database selected
+DELETE t1 FROM db1.t1, db2.t1;
+ERROR 3D000: No database selected
+USE test;
+DELETE a1,a2 FROM db1.t1, db2.t2;
+ERROR 42S02: Unknown table 'a1' in MULTI DELETE
+DELETE a1,a2 FROM db1.t1, db2.t2;
+ERROR 42S02: Unknown table 'a1' in MULTI DELETE
+DELETE a1,a2 FROM db1.t1 AS a1, db2.t2;
+ERROR 42S02: Unknown table 'a2' in MULTI DELETE
+DELETE a1,a2 FROM db1.t1, db2.t2 AS a2;
+ERROR 42S02: Unknown table 'a1' in MULTI DELETE
+DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
+ERROR 42S02: Table 'db3.t1' doesn't exist
+DELETE a1,a2 FROM db3.t1 AS a1, db4.t2 AS a2;
+ERROR 42S02: Table 'db3.t1' doesn't exist
+DELETE FROM a1,a2 USING db1.t1, db2.t2;
+ERROR 42S02: Unknown table 'a1' in MULTI DELETE
+DELETE FROM a1,a2 USING db1.t1, db2.t2;
+ERROR 42S02: Unknown table 'a1' in MULTI DELETE
+DELETE FROM a1,a2 USING db1.t1 AS a1, db2.t2;
+ERROR 42S02: Unknown table 'a2' in MULTI DELETE
+DELETE FROM a1,a2 USING db1.t1, db2.t2 AS a2;
+ERROR 42S02: Unknown table 'a1' in MULTI DELETE
+DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
+ERROR 42S02: Table 'db3.t1' doesn't exist
+DELETE FROM a1,a2 USING db3.t1 AS a1, db4.t2 AS a2;
+ERROR 42S02: Table 'db3.t1' doesn't exist
+DELETE a1 FROM db1.t1 AS a1, db2.t2 AS a1;
+ERROR 42000: Not unique table/alias: 'a1'
+DELETE a1 FROM db1.a1, db2.t2 AS a1;
+ERROR 42S02: Table 'db1.a1' doesn't exist
+DELETE a1 FROM a1, db1.t1 AS a1;
+ERROR 42000: Not unique table/alias: 'a1'
+DELETE t1 FROM db1.t1, db2.t1 AS a1;
+ERROR 42S02: Unknown table 't1' in MULTI DELETE
+DELETE t1 FROM db1.t1 AS a1, db2.t1 AS a2;
+ERROR 42S02: Unknown table 't1' in MULTI DELETE
+DELETE t1 FROM db1.t1, db2.t1;
+ERROR 42S02: Unknown table 't1' in MULTI DELETE
+DELETE t1 FROM db1.t2 AS t1, db2.t2 AS t2 WHERE t2.a = 1 AND t1.a = t2.a;
+SELECT ROW_COUNT();
+ROW_COUNT()
+1
+CALL count_rows();
+COUNT(db1.t1)
+3
+COUNT(db1.t2)
+2
+COUNT(db2.t1)
+3
+COUNT(db2.t2)
+3
+COUNT(test.t1)
+3
+COUNT(test.t2)
+3
+DELETE a1, a2 FROM db2.t1 AS a1, t2 AS a2 WHERE a1.a = 2 AND a2.a = 2;
+SELECT ROW_COUNT();
+ROW_COUNT()
+2
+CALL count_rows();
+COUNT(db1.t1)
+3
+COUNT(db1.t2)
+2
+COUNT(db2.t1)
+2
+COUNT(db2.t2)
+3
+COUNT(test.t1)
+3
+COUNT(test.t2)
+2
+DROP DATABASE db1;
+DROP DATABASE db2;
+DROP PROCEDURE count_rows;
+DROP TABLE t1, t2;
#
# Bug#46958: Assertion in Diagnostics_area::set_ok_status, trigger,
# merge table
diff --git a/mysql-test/r/deprecated_features.result b/mysql-test/r/deprecated_features.result
new file mode 100644
index 00000000000..ecfb830542d
--- /dev/null
+++ b/mysql-test/r/deprecated_features.result
@@ -0,0 +1,26 @@
+set global log_bin_trust_routine_creators=1;
+ERROR HY000: Unknown system variable 'log_bin_trust_routine_creators'
+set table_type='MyISAM';
+ERROR HY000: Unknown system variable 'table_type'
+select @@table_type='MyISAM';
+ERROR HY000: Unknown system variable 'table_type'
+backup table t1 to 'data.txt';
+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 'backup table t1 to 'data.txt'' at line 1
+restore table t1 from 'data.txt';
+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 'restore table t1 from 'data.txt'' at line 1
+show plugin;
+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 'plugin' at line 1
+load table t1 from master;
+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 'table t1 from master' at line 1
+load data from master;
+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 'from master' at line 1
+SHOW INNODB STATUS;
+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 'INNODB STATUS' at line 1
+create table t1 (t6 timestamp(6));
+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 '(6))' at line 1
+create table t1 (t6 timestamp) type=myisam;
+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 'type=myisam' at line 1
+show table types;
+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 'types' at line 1
+show mutex status;
+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 'mutex status' at line 1
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 80f04ffd455..53cd89c13c1 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -277,7 +277,7 @@ select * from t1;
N M
3 0
delete P1.*,p2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS p2 ON P1.N = p2.N;
-ERROR 42S02: Unknown table 'p2' in MULTI DELETE
+ERROR HY000: The target table p2 of the DELETE is not updatable
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
ERROR 42S22: Unknown column 'aaa' in 'field list'
drop table t1;
diff --git a/mysql-test/r/dirty_close.result b/mysql-test/r/dirty_close.result
index b49b72f1b95..f7012ff9c01 100644
--- a/mysql-test/r/dirty_close.result
+++ b/mysql-test/r/dirty_close.result
@@ -7,3 +7,13 @@ n
2
3
DROP TABLE t1;
+SELECT GET_LOCK("dangling", 0);
+GET_LOCK("dangling", 0)
+1
+SELECT GET_LOCK('dangling', 3600);;
+SELECT GET_LOCK('dangling', 3600);;
+SELECT RELEASE_LOCK('dangling');
+RELEASE_LOCK('dangling')
+1
+GET_LOCK('dangling', 3600)
+1
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..ae75f21955e 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -50,6 +50,7 @@ information_schema
mtr
mysql
mysqltest
+performance_schema
test
flush tables with read lock;
drop database mysqltest;
@@ -61,6 +62,7 @@ Database
information_schema
mtr
mysql
+performance_schema
test
drop database mysqltest;
ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist
@@ -86,6 +88,26 @@ select 1;
1
1
unlock tables;
+drop table if exists t1,t2;
+create table t1 (a int);
+create table t2 (a int);
+lock table t1 read;
+drop table t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+drop table t1;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+unlock tables;
+drop table t1,t2;
+create table t1 (i int);
+create table t2 (i int);
+lock tables t1 read;
+lock tables t2 read;
+drop table t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
+drop table t1,t2;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+unlock tables;
+drop table t1,t2;
End of 5.0 tests
create database mysql_test;
create table mysql_test.t1(f1 int);
@@ -121,3 +143,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..79474b960f5 100644
--- a/mysql-test/r/errors.result
+++ b/mysql-test/r/errors.result
@@ -55,3 +55,68 @@ 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;
+flush status;
+drop table if exists t1, t2;
+create table t1 (a int unique);
+create table t2 (a int);
+drop function if exists f1;
+Warnings:
+Note 1305 FUNCTION f1 does not exist
+drop function if exists f2;
+Warnings:
+Note 1305 FUNCTION f2 does not exist
+create function f1() returns int
+begin
+insert into t1 (a) values (1);
+insert into t1 (a) values (1);
+return 1;
+end|
+create function f2() returns int
+begin
+insert into t2 (a) values (1);
+return 2;
+end|
+flush status;
+select f1(), f2();
+ERROR 23000: Duplicate entry '1' for key 'a'
+show status like 'Com_insert';
+Variable_name Value
+Com_insert 2
+select * from t1;
+a
+1
+select * from t2;
+a
+drop table t1;
+drop table t2;
+drop function f1;
+drop function f2;
+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 'TRÜ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..530d8559f11 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -13,12 +13,6 @@ ERROR HY000: Incorrect AT value: 'definitely not a datetime'
set names utf8;
create event заЎачка on schedule every 123 minute starts now() ends now() + interval 1 month do select 1;
drop event заЎачка;
-set event_scheduler=off;
-ERROR HY000: Variable 'event_scheduler' is a GLOBAL variable and should be set with SET GLOBAL
-set global event_scheduler=3;
-ERROR 42000: Variable 'event_scheduler' can't be set to the value of '3'
-set global event_scheduler=disabled;
-ERROR 42000: Variable 'event_scheduler' can't be set to the value of 'disabled'
"DISABLE the scheduler. Testing that it does not work when the variable is 0"
set global event_scheduler=off;
select definer, name, db from mysql.event;
@@ -134,7 +128,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 +146,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 +164,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 +182,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 +204,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..a5003c936e8 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';
@@ -725,16 +725,15 @@ DROP USER mysqltest_u1@localhost;
drop procedure if exists p;
set @old_mode= @@sql_mode;
-set @@sql_mode= pow(2,32)-1;
+set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
create event e1 on schedule every 1 day do select 1;
-select @@sql_mode;
-@@sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,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,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
+select @@sql_mode into @full_mode;
set @@sql_mode= @old_mode;
-select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
-select name from mysql.event where name = 'p' and sql_mode = @full_mode;
+select name from mysql.event where name = 'e1' and sql_mode = @full_mode;
name
+e1
drop event e1;
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
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/events_scheduling.result b/mysql-test/r/events_scheduling.result
index 7dfd10a53f8..262caea3d7f 100644
--- a/mysql-test/r/events_scheduling.result
+++ b/mysql-test/r/events_scheduling.result
@@ -82,5 +82,24 @@ DROP TABLE table_1;
DROP TABLE table_2;
DROP TABLE table_3;
DROP TABLE table_4;
+
+Bug #50087 Interval arithmetic for Event_queue_element is not portable.
+
+CREATE TABLE t1(a int);
+CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH
+STARTS NOW() - INTERVAL 1 MONTH
+ENDS NOW() + INTERVAL 2 MONTH
+ON COMPLETION PRESERVE
+DO
+INSERT INTO t1 VALUES (1);
+CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH
+STARTS NOW()
+ENDS NOW() + INTERVAL 11 MONTH
+ON COMPLETION PRESERVE
+DO
+INSERT INTO t1 VALUES (1);
+DROP TABLE t1;
+DROP EVENT e1;
+DROP EVENT e2;
DROP DATABASE events_test;
SET GLOBAL event_scheduler=@event_scheduler;
diff --git a/mysql-test/r/exampledb.result b/mysql-test/r/exampledb.result
deleted file mode 100644
index 6eea24e2e1f..00000000000
--- a/mysql-test/r/exampledb.result
+++ /dev/null
@@ -1,8 +0,0 @@
-drop database if exists events_test;
-drop database if exists events_test2;
-drop table if exists t1;
-CREATE TABLE t1 (
-Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
-Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL
-) ENGINE=example;
-drop table t1;
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/flush2.result b/mysql-test/r/flush2.result
index 5056955c7b7..13bcc371ef6 100644
--- a/mysql-test/r/flush2.result
+++ b/mysql-test/r/flush2.result
@@ -4,11 +4,9 @@ show variables like 'log_bin%';
Variable_name Value
log_bin OFF
log_bin_trust_function_creators ON
-log_bin_trust_routine_creators ON
flush logs;
show variables like 'log_bin%';
Variable_name Value
log_bin OFF
log_bin_trust_function_creators ON
-log_bin_trust_routine_creators ON
set global expire_logs_days = 0;
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 1ef6656e7a4..4b651e270e6 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -49,7 +49,7 @@ a b
Full-text indexes are called collections
Only MyISAM tables support collections
select * from t1 where MATCH(a,b) AGAINST ("indexes" IN BOOLEAN MODE WITH QUERY EXPANSION);
-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 'WITH QUERY EXPANSION)' at line 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 'QUERY EXPANSION)' at line 1
explain select * from t1 where MATCH(a,b) AGAINST ("collections");
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
@@ -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_group.result b/mysql-test/r/func_group.result
index b36f561578b..6838dcf944c 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -61,7 +61,7 @@ grp sum
NULL NULL
1 7
2 20.25
-3 45.4831632475944
+3 45.48316324759439
create table t2 (grp int, a bigint unsigned, c char(10));
insert into t2 select grp,max(a)+max(grp),max(c) from t1 group by grp;
replace into t2 select grp, a, c from t1 limit 2,1;
@@ -891,7 +891,7 @@ select 1e8 * sum(distinct df) from t1;
330000000
select 1e8 * min(df) from t1;
1e8 * min(df)
-110000000
+110000000.00000001
create table t3 (ifl int);
insert into t3 values(1), (2);
select cast(min(ifl) as decimal(5,2)) from t3;
@@ -1186,7 +1186,7 @@ std(s1/s2)
0.21325764
select std(o1/o2) from bug22555;
std(o1/o2)
-0.213257635866493
+0.2132576358664934
select std(e1/e2) from bug22555;
std(e1/e2)
0.21325764
@@ -1209,13 +1209,13 @@ i count(*) std(e1/e2)
3 4 0.000000000000000000000000000000
select round(std(s1/s2), 17) from bug22555;
round(std(s1/s2), 17)
-0.21325763586649341
+0.21325763586649340
select std(o1/o2) from bug22555;
std(o1/o2)
-0.213257635866493
+0.2132576358664934
select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17)
-0.21325763586649341
+0.21325763586649340
set div_precision_increment=20;
select i, count(*), std(s1/s2) from bug22555 group by i order by i;
i count(*) std(s1/s2)
@@ -1234,13 +1234,13 @@ i count(*) std(e1/e2)
3 4 0.000000000000000000000000000000
select round(std(s1/s2), 17) from bug22555;
round(std(s1/s2), 17)
-0.21325763586649341
+0.21325763586649340
select std(o1/o2) from bug22555;
std(o1/o2)
-0.213257635866493
+0.2132576358664934
select round(std(e1/e2), 17) from bug22555;
round(std(e1/e2), 17)
-0.21325763586649341
+0.21325763586649340
set @@div_precision_increment=@saved_div_precision_increment;
drop table bug22555;
create table bug22555 (s smallint, o double, e decimal);
diff --git a/mysql-test/r/func_isnull.result b/mysql-test/r/func_isnull.result
index 20ddc87ee78..79aecc7d82b 100644
--- a/mysql-test/r/func_isnull.result
+++ b/mysql-test/r/func_isnull.result
@@ -5,3 +5,8 @@ flush tables;
select * from t1 where isnull(to_days(mydate));
id mydate
drop table t1;
+CREATE TABLE t1 (id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY(id));
+INSERT INTO t1( id ) VALUES ( NULL );
+SELECT t1.id FROM t1 WHERE (id is not null and id is null );
+id
+DROP TABLE t1;
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index 9338a76e320..8d0f34f3bda 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -10,7 +10,7 @@ explain extended select * from t1 where a like concat('abc','%');
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 index a a 13 NULL 5 20.00 Using where; Using index
Warnings:
-Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like concat('abc','%'))
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like <cache>(concat('abc','%')))
select * from t1 where a like "abc%";
a
abc
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index fd7ef72409e..537b1db9781 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -44,7 +44,7 @@ Warnings:
Note 1003 select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
log(exp(10)) exp(log(sqrt(10))*2) log(-1) log(NULL) log(1,1) log(3,9) log(-1,2) log(NULL,2)
-10 10 NULL NULL NULL 2 NULL NULL
+10 10.000000000000002 NULL NULL NULL 2 NULL NULL
explain extended select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
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
@@ -52,7 +52,7 @@ Warnings:
Note 1003 select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
ln(exp(10)) exp(ln(sqrt(10))*2) ln(-1) ln(0) ln(NULL)
-10 10 NULL NULL NULL
+10 10.000000000000002 NULL NULL NULL
explain extended select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
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
@@ -60,7 +60,7 @@ Warnings:
Note 1003 select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
log2(8) log2(15) log2(-2) log2(0) log2(NULL)
-3 3.90689059560852 NULL NULL NULL
+3 3.9068905956085187 NULL NULL NULL
explain extended select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
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
@@ -68,7 +68,7 @@ Warnings:
Note 1003 select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
log10(100) log10(18) log10(-4) log10(0) log10(NULL)
-2 1.25527250510331 NULL NULL NULL
+2 1.255272505103306 NULL NULL NULL
explain extended select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
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
@@ -85,7 +85,7 @@ Note 1003 select pow(10,log10(10)) AS `pow(10,log10(10))`,pow(2,4) AS `power(2,4
set @@rand_seed1=10000000,@@rand_seed2=1000000;
select rand(999999),rand();
rand(999999) rand()
-0.0142313651873091 0.028870999839968
+0.014231365187309091 0.028870999839968048
explain extended select rand(999999),rand();
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
@@ -101,7 +101,7 @@ Warnings:
Note 1003 select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
select degrees(pi()),radians(360);
degrees(pi()) radians(360)
-180 6.28318530717959
+180 6.283185307179586
select format(atan(-2, 2), 6);
format(atan(-2, 2), 6)
-0.785398
@@ -119,7 +119,7 @@ ACOS(1.0)
0
SELECT ASIN(1.0);
ASIN(1.0)
-1.5707963267949
+1.5707963267948966
SELECT ACOS(0.2*5.0);
ACOS(0.2*5.0)
0
@@ -128,10 +128,10 @@ ACOS(0.5*2.0)
0
SELECT ASIN(0.8+0.2);
ASIN(0.8+0.2)
-1.5707963267949
+1.5707963267948966
SELECT ASIN(1.2-0.2);
ASIN(1.2-0.2)
-1.5707963267949
+1.5707963267948966
select format(4.55, 1), format(4.551, 1);
format(4.55, 1) format(4.551, 1)
4.6 4.6
@@ -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)
@@ -368,7 +368,7 @@ mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2)
5 5 1
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
-2.13598703592091e+96 2.13598703592091e+96 -32
+2.13598703592091e96 2.13598703592091e96 -32
CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
SELECT a DIV 900 y FROM t1 GROUP BY y;
@@ -382,6 +382,11 @@ y
SELECT b DIV 900 y FROM t1 GROUP BY y;
y
0
+Warnings:
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: 'str1'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: 'str2'
SELECT c DIV 900 y FROM t1 GROUP BY y;
y
0
@@ -432,10 +437,10 @@ a ROUND(a)
2.5 2
-2.9 -3
2.9 3
--1e+16 -10000000000000000
-1e+16 10000000000000000
--1e+16 -10000000000000002
-1e+16 10000000000000002
+-1e16 -10000000000000000
+1e16 10000000000000000
+-1.0000000000000002e16 -10000000000000002
+1.0000000000000002e16 10000000000000002
DROP TABLE t1;
CREATE TABLE t1(f1 LONGTEXT) engine=myisam;
INSERT INTO t1 VALUES ('a');
@@ -470,16 +475,24 @@ NULL
CREATE OR REPLACE VIEW v1 AS SELECT NULL AS a;
SELECT RAND(a) FROM v1;
RAND(a)
-0.155220427694936
+0.15522042769493574
DROP VIEW v1;
SELECT RAND(a) FROM (SELECT NULL AS a) b;
RAND(a)
-0.155220427694936
+0.15522042769493574
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (NULL);
SELECT RAND(i) FROM t1;
RAND(i)
-0.155220427694936
+0.15522042769493574
DROP TABLE t1;
#
+select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
+ERROR 22003: Out of range value for column 'x' at row 1
+select "123456789012345678901234567890.123456789012345678901234567890" div 1 as x;
+ERROR 22003: Out of range value for column 'x' at row 1
+SHOW WARNINGS;
+Level Code Message
+Warning 1292 Truncated incorrect DECIMAL value: ''
+Error 1264 Out of range value for column 'x' at row 1
End of 5.1 tests
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..2d6154cd1f7 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
@@ -282,3 +282,33 @@ TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')),
TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'));
1Eq 1NEq1 1NEq2 2Eq 2NEq1 2NEq2 3Eq 3NEq1 3NEq2 Time0 Time00 Literal0000 TIMEDIFF(TIME('17:59:00'),TIME('17:00:00')) TIMEDIFF(TIME('17:00:00'),TIME('17:59:00'))
1 0 0 1 0 0 1 0 0 00:00:00 00:00:00 00:00:00 00:59:00 -00:59:00
+SELECT sec_to_time(3020399)=TIME('838:59:59');
+sec_to_time(3020399)=TIME('838:59:59')
+1
+SELECT sec_to_time(-3020399)=TIME('-838:59:59');
+sec_to_time(-3020399)=TIME('-838:59:59')
+1
+SELECT sec_to_time(-3020399)='-838:59:59';
+sec_to_time(-3020399)='-838:59:59'
+1
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:59');
+time(sec_to_time(-3020399))=TIME('-838:59:59')
+1
+SELECT time(sec_to_time(-3020399))=TIME('-838:59:58');
+time(sec_to_time(-3020399))=TIME('-838:59:58')
+0
+SELECT maketime(-1,0,1)='-01:00:01';
+maketime(-1,0,1)='-01:00:01'
+1
+SELECT TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME);
+TIME(maketime(-1,0,1))=CAST('-01:00:01' AS TIME)
+1
+SELECT maketime(-1,0,1)=CAST('-01:00:01' AS TIME);
+maketime(-1,0,1)=CAST('-01:00:01' AS TIME)
+1
+SELECT maketime(1,0,1)=CAST('01:00:01' AS TIME);
+maketime(1,0,1)=CAST('01:00:01' AS TIME)
+1
+SELECT maketime(1,0,1)=CAST('01:00:02' AS TIME);
+maketime(1,0,1)=CAST('01:00:02' AS TIME)
+0
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index d144e84dfdc..3d43cbbfd76 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
@@ -1351,10 +1354,10 @@ cast(rtrim(ltrim(' 20.06 ')) as decimal(19,2))
20.06
select conv("18383815659218730760",10,10) + 0;
conv("18383815659218730760",10,10) + 0
-1.83838156592187e+19
+1.838381565921873e19
select "18383815659218730760" + 0;
"18383815659218730760" + 0
-1.83838156592187e+19
+1.838381565921873e19
CREATE TABLE t1 (code varchar(10));
INSERT INTO t1 VALUES ('a12'), ('A12'), ('a13');
SELECT ASCII(code), code FROM t1 WHERE code='A12';
@@ -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))
@@ -2587,3 +2590,133 @@ FROM t2 WHERE t2.b = 1 GROUP BY t2.b;
DECODE((SELECT ENCODE('secret', t1.a) FROM t1,t2 WHERE t1.a = t2.a GROUP BY t1.b LIMIT 1), t2.a)
secret
DROP TABLE t1, t2;
+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..7bcaf5567cf 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
@@ -928,7 +928,6 @@ select f1 from t1 where cast("2006-1-1" as date) between f1 and cast('zzz' as da
f1
Warnings:
Warning 1292 Incorrect datetime value: 'zzz'
-Warning 1292 Incorrect datetime value: 'zzz'
select f1 from t1 where makedate(2006,1) between date(f1) and date(f3);
f1
2006-01-01
@@ -1301,6 +1300,12 @@ SELECT '2008-02-18' + INTERVAL 1 FRAC_SECOND;
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 'FRAC_SECOND' at line 1
SELECT '2008-02-18' - INTERVAL 1 FRAC_SECOND;
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 'FRAC_SECOND' at line 1
+select date_add('1000-01-01 00:00:00', interval '1.03:02:01.05' day_microsecond);
+date_add('1000-01-01 00:00:00', interval '1.03:02:01.05' day_microsecond)
+1000-01-02 03:02:01.050000
+select date_add('1000-01-01 00:00:00', interval '1.02' day_microsecond);
+date_add('1000-01-01 00:00:00', interval '1.02' day_microsecond)
+1000-01-01 00:00:01.020000
End of 5.0 tests
select date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND);
date_sub("0050-01-01 00:00:01",INTERVAL 2 SECOND)
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 3e28227d542..60e24819fa5 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -258,7 +258,7 @@ fid AsText(EndPoint(g))
107 POINT(40 10)
SELECT fid, GLength(g) FROM gis_line;
fid GLength(g)
-105 24.142135623731
+105 24.14213562373095
106 40
107 30
SELECT fid, NumPoints(g) FROM gis_line;
@@ -284,7 +284,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
fid AsText(Centroid(g))
108 POINT(15 15)
-109 POINT(25.4166666666667 25.4166666666667)
+109 POINT(25.416666666666668 25.416666666666668)
110 POINT(20 10)
SELECT fid, Area(g) FROM gis_polygon;
fid Area(g)
@@ -318,8 +318,8 @@ fid IsClosed(g)
116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
fid AsText(Centroid(g))
-117 POINT(55.5885277530424 17.426536064114)
-118 POINT(55.5885277530424 17.426536064114)
+117 POINT(55.58852775304245 17.426536064113982)
+118 POINT(55.58852775304245 17.426536064113982)
119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon;
fid Area(g)
@@ -651,11 +651,11 @@ insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85998;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
-85998 MULTIPOLYGON 0 POINT(115.318773152032 -36.2374728210215)
+85998 MULTIPOLYGON 0 POINT(115.31877315203187 -36.23747282102153)
select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from
t1 where object_id=85984;
object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo))
-85984 MULTIPOLYGON 0 POINT(-114.877871869233 36.3310176346905)
+85984 MULTIPOLYGON 0 POINT(-114.87787186923313 36.33101763469059)
drop table t1;
create table t1 (fl geometry not null);
insert into t1 values (1);
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_by.result b/mysql-test/r/group_by.result
index 742d4b90807..e6063047ba4 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -107,8 +107,9 @@ SELECT cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
SELECT HIGH_PRIORITY cid, CONCAT(firstname, ' ', surname), COUNT(call_id) FROM t1 LEFT JOIN t2 ON cid=contact_id WHERE firstname like '%foo%' GROUP BY cid ORDER BY surname, firstname;
cid CONCAT(firstname, ' ', surname) COUNT(call_id)
-drop table t1,t2;
+drop table t2;
unlock tables;
+drop table t1;
CREATE TABLE t1 (
bug_id mediumint(9) NOT NULL auto_increment,
groupset bigint(20) DEFAULT '0' NOT NULL,
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_dynamic_loading.require b/mysql-test/r/have_dynamic_loading.require
deleted file mode 100644
index 2d21f65e4ac..00000000000
--- a/mysql-test/r/have_dynamic_loading.require
+++ /dev/null
@@ -1,2 +0,0 @@
-Variable_name Value
-have_dynamic_loading YES
diff --git a/mysql-test/r/have_example_plugin.require b/mysql-test/r/have_example_plugin.require
deleted file mode 100644
index 291b8231cbb..00000000000
--- a/mysql-test/r/have_example_plugin.require
+++ /dev/null
@@ -1,2 +0,0 @@
-have_example_plugin
-1
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..54caeba1dae
--- /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/have_simple_parser.require b/mysql-test/r/have_simple_parser.require
deleted file mode 100644
index 0e023bd6983..00000000000
--- a/mysql-test/r/have_simple_parser.require
+++ /dev/null
@@ -1,2 +0,0 @@
-have_simple_parser
-1
diff --git a/mysql-test/r/have_udf_example.require b/mysql-test/r/have_udf_example.require
deleted file mode 100644
index e60fab1dbe0..00000000000
--- a/mysql-test/r/have_udf_example.require
+++ /dev/null
@@ -1,2 +0,0 @@
-have_udf_example_lib
-1
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/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result
index 588de70e6e5..6d130a64e35 100644
--- a/mysql-test/r/index_merge_innodb.result
+++ b/mysql-test/r/index_merge_innodb.result
@@ -1,329 +1,3 @@
-#---------------- Index merge test 2 -------------------------------------------
-SET SESSION STORAGE_ENGINE = InnoDB;
-drop table if exists t1,t2;
-create table t1
-(
-key1 int not null,
-key2 int not null,
-INDEX i1(key1),
-INDEX i2(key2)
-);
-explain select * from t1 where key1 < 5 or key2 > 197;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge i1,i2 i1,i2 4,4 NULL 8 Using sort_union(i1,i2); Using where
-select * from t1 where key1 < 5 or key2 > 197;
-key1 key2
-0 200
-1 199
-2 198
-3 197
-4 196
-explain select * from t1 where key1 < 3 or key2 > 195;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge i1,i2 i1,i2 4,4 NULL 8 Using sort_union(i1,i2); Using where
-select * from t1 where key1 < 3 or key2 > 195;
-key1 key2
-0 200
-1 199
-2 198
-3 197
-4 196
-alter table t1 add str1 char (255) not null,
-add zeroval int not null default 0,
-add str2 char (255) not null,
-add str3 char (255) not null;
-update t1 set str1='aaa', str2='bbb', str3=concat(key2, '-', key1 div 2, '_' ,if(key1 mod 2 = 0, 'a', 'A'));
-alter table t1 add primary key (str1, zeroval, str2, str3);
-explain select * from t1 where key1 < 5 or key2 > 197;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge i1,i2 i1,i2 4,4 NULL 8 Using sort_union(i1,i2); Using where
-select * from t1 where key1 < 5 or key2 > 197;
-key1 key2 str1 zeroval str2 str3
-4 196 aaa 0 bbb 196-2_a
-3 197 aaa 0 bbb 197-1_A
-2 198 aaa 0 bbb 198-1_a
-1 199 aaa 0 bbb 199-0_A
-0 200 aaa 0 bbb 200-0_a
-explain select * from t1 where key1 < 3 or key2 > 195;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge i1,i2 i1,i2 4,4 NULL 8 Using sort_union(i1,i2); Using where
-select * from t1 where key1 < 3 or key2 > 195;
-key1 key2 str1 zeroval str2 str3
-4 196 aaa 0 bbb 196-2_a
-3 197 aaa 0 bbb 197-1_A
-2 198 aaa 0 bbb 198-1_a
-1 199 aaa 0 bbb 199-0_A
-0 200 aaa 0 bbb 200-0_a
-drop table t1;
-create table t1 (
-pk integer not null auto_increment primary key,
-key1 integer,
-key2 integer not null,
-filler char (200),
-index (key1),
-index (key2)
-);
-show warnings;
-Level Code Message
-explain select pk from t1 where key1 = 1 and key2 = 1;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge key1,key2 key1,key2 5,4 NULL 1 Using intersect(key1,key2); Using where; Using index
-select pk from t1 where key2 = 1 and key1 = 1;
-pk
-26
-27
-select pk from t1 ignore index(key1,key2) where key2 = 1 and key1 = 1;
-pk
-26
-27
-drop table t1;
-create table t1 (
-pk int primary key auto_increment,
-key1a int,
-key2a int,
-key1b int,
-key2b int,
-dummy1 int,
-dummy2 int,
-dummy3 int,
-dummy4 int,
-key3a int,
-key3b int,
-filler1 char (200),
-index i1(key1a, key1b),
-index i2(key2a, key2b),
-index i3(key3a, key3b)
-);
-create table t2 (a int);
-insert into t2 values (0),(1),(2),(3),(4),(NULL);
-insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
-select A.a, B.a, C.a, D.a, C.a, D.a from t2 A,t2 B,t2 C, t2 D;
-insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
-select key1a, key1b, key2a, key2b, key3a, key3b from t1;
-insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b)
-select key1a, key1b, key2a, key2b, key3a, key3b from t1;
-analyze table t1;
-Table Op Msg_type Msg_text
-test.t1 analyze status OK
-select count(*) from t1;
-count(*)
-5184
-explain select count(*) from t1 where
-key1a = 2 and key1b is null and key2a = 2 and key2b is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 4 Using intersect(i1,i2); Using where; Using index
-select count(*) from t1 where
-key1a = 2 and key1b is null and key2a = 2 and key2b is null;
-count(*)
-4
-explain select count(*) from t1 where
-key1a = 2 and key1b is null and key3a = 2 and key3b is null;
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 4 Using intersect(i1,i3); Using where; Using index
-select count(*) from t1 where
-key1a = 2 and key1b is null and key3a = 2 and key3b is null;
-count(*)
-4
-drop table t1,t2;
-create table t1 (
-id1 int,
-id2 date ,
-index idx2 (id1,id2),
-index idx1 (id2)
-);
-insert into t1 values(1,'20040101'), (2,'20040102');
-select * from t1 where id1 = 1 and id2= '20040101';
-id1 id2
-1 2004-01-01
-drop table t1;
-drop view if exists v1;
-CREATE TABLE t1 (
-`oid` int(11) unsigned NOT NULL auto_increment,
-`fk_bbk_niederlassung` int(11) unsigned NOT NULL,
-`fk_wochentag` int(11) unsigned NOT NULL,
-`uhrzeit_von` time NOT NULL COMMENT 'HH:MM',
-`uhrzeit_bis` time NOT NULL COMMENT 'HH:MM',
-`geloescht` tinyint(4) NOT NULL,
-`version` int(5) NOT NULL,
-PRIMARY KEY (`oid`),
-KEY `fk_bbk_niederlassung` (`fk_bbk_niederlassung`),
-KEY `fk_wochentag` (`fk_wochentag`),
-KEY `ix_version` (`version`)
-) DEFAULT CHARSET=latin1;
-insert into t1 values
-(1, 38, 1, '08:00:00', '13:00:00', 0, 1),
-(2, 38, 2, '08:00:00', '13:00:00', 0, 1),
-(3, 38, 3, '08:00:00', '13:00:00', 0, 1),
-(4, 38, 4, '08:00:00', '13:00:00', 0, 1),
-(5, 38, 5, '08:00:00', '13:00:00', 0, 1),
-(6, 38, 5, '08:00:00', '13:00:00', 1, 2),
-(7, 38, 3, '08:00:00', '13:00:00', 1, 2),
-(8, 38, 1, '08:00:00', '13:00:00', 1, 2),
-(9, 38, 2, '08:00:00', '13:00:00', 1, 2),
-(10, 38, 4, '08:00:00', '13:00:00', 1, 2),
-(11, 38, 1, '08:00:00', '13:00:00', 0, 3),
-(12, 38, 2, '08:00:00', '13:00:00', 0, 3),
-(13, 38, 3, '08:00:00', '13:00:00', 0, 3),
-(14, 38, 4, '08:00:00', '13:00:00', 0, 3),
-(15, 38, 5, '08:00:00', '13:00:00', 0, 3),
-(16, 38, 4, '08:00:00', '13:00:00', 0, 4),
-(17, 38, 5, '08:00:00', '13:00:00', 0, 4),
-(18, 38, 1, '08:00:00', '13:00:00', 0, 4),
-(19, 38, 2, '08:00:00', '13:00:00', 0, 4),
-(20, 38, 3, '08:00:00', '13:00:00', 0, 4),
-(21, 7, 1, '08:00:00', '13:00:00', 0, 1),
-(22, 7, 2, '08:00:00', '13:00:00', 0, 1),
-(23, 7, 3, '08:00:00', '13:00:00', 0, 1),
-(24, 7, 4, '08:00:00', '13:00:00', 0, 1),
-(25, 7, 5, '08:00:00', '13:00:00', 0, 1);
-create view v1 as
-select
-zeit1.oid AS oid,
-zeit1.fk_bbk_niederlassung AS fk_bbk_niederlassung,
-zeit1.fk_wochentag AS fk_wochentag,
-zeit1.uhrzeit_von AS uhrzeit_von,
-zeit1.uhrzeit_bis AS uhrzeit_bis,
-zeit1.geloescht AS geloescht,
-zeit1.version AS version
-from
-t1 zeit1
-where
-(zeit1.version =
-(select max(zeit2.version) AS `max(version)`
- from t1 zeit2
-where
-((zeit1.fk_bbk_niederlassung = zeit2.fk_bbk_niederlassung) and
-(zeit1.fk_wochentag = zeit2.fk_wochentag) and
-(zeit1.uhrzeit_von = zeit2.uhrzeit_von) and
-(zeit1.uhrzeit_bis = zeit2.uhrzeit_bis)
-)
-)
-)
-and (zeit1.geloescht = 0);
-select * from v1 where oid = 21;
-oid fk_bbk_niederlassung fk_wochentag uhrzeit_von uhrzeit_bis geloescht version
-21 7 1 08:00:00 13:00:00 0 1
-drop view v1;
-drop table t1;
-CREATE TABLE t1(
-t_cpac varchar(2) NOT NULL,
-t_vers varchar(4) NOT NULL,
-t_rele varchar(2) NOT NULL,
-t_cust varchar(4) NOT NULL,
-filler1 char(250) default NULL,
-filler2 char(250) default NULL,
-PRIMARY KEY (t_cpac,t_vers,t_rele,t_cust),
-UNIQUE KEY IX_4 (t_cust,t_cpac,t_vers,t_rele),
-KEY IX_5 (t_vers,t_rele,t_cust)
-);
-insert into t1 values
-('tm','2.5 ','a ',' ','',''), ('tm','2.5U','a ','stnd','',''),
-('da','3.3 ','b ',' ','',''), ('da','3.3U','b ','stnd','',''),
-('tl','7.6 ','a ',' ','',''), ('tt','7.6 ','a ',' ','',''),
-('bc','B61 ','a ',' ','',''), ('bp','B61 ','a ',' ','',''),
-('ca','B61 ','a ',' ','',''), ('ci','B61 ','a ',' ','',''),
-('cp','B61 ','a ',' ','',''), ('dm','B61 ','a ',' ','',''),
-('ec','B61 ','a ',' ','',''), ('ed','B61 ','a ',' ','',''),
-('fm','B61 ','a ',' ','',''), ('nt','B61 ','a ',' ','',''),
-('qm','B61 ','a ',' ','',''), ('tc','B61 ','a ',' ','',''),
-('td','B61 ','a ',' ','',''), ('tf','B61 ','a ',' ','',''),
-('tg','B61 ','a ',' ','',''), ('ti','B61 ','a ',' ','',''),
-('tp','B61 ','a ',' ','',''), ('ts','B61 ','a ',' ','',''),
-('wh','B61 ','a ',' ','',''), ('bc','B61U','a ','stnd','',''),
-('bp','B61U','a ','stnd','',''), ('ca','B61U','a ','stnd','',''),
-('ci','B61U','a ','stnd','',''), ('cp','B61U','a ','stnd','',''),
-('dm','B61U','a ','stnd','',''), ('ec','B61U','a ','stnd','',''),
-('fm','B61U','a ','stnd','',''), ('nt','B61U','a ','stnd','',''),
-('qm','B61U','a ','stnd','',''), ('tc','B61U','a ','stnd','',''),
-('td','B61U','a ','stnd','',''), ('tf','B61U','a ','stnd','',''),
-('tg','B61U','a ','stnd','',''), ('ti','B61U','a ','stnd','',''),
-('tp','B61U','a ','stnd','',''), ('ts','B61U','a ','stnd','',''),
-('wh','B61U','a ','stnd','','');
-show create table t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `t_cpac` varchar(2) NOT NULL,
- `t_vers` varchar(4) NOT NULL,
- `t_rele` varchar(2) NOT NULL,
- `t_cust` varchar(4) NOT NULL,
- `filler1` char(250) DEFAULT NULL,
- `filler2` char(250) DEFAULT NULL,
- PRIMARY KEY (`t_cpac`,`t_vers`,`t_rele`,`t_cust`),
- UNIQUE KEY `IX_4` (`t_cust`,`t_cpac`,`t_vers`,`t_rele`),
- KEY `IX_5` (`t_vers`,`t_rele`,`t_cust`)
-) ENGINE=InnoDB DEFAULT CHARSET=latin1
-select t_vers,t_rele,t_cust,filler1 from t1 where t_vers = '7.6';
-t_vers t_rele t_cust filler1
-7.6 a
-7.6 a
-select t_vers,t_rele,t_cust,filler1 from t1 where t_vers = '7.6'
- and t_rele='a' and t_cust = ' ';
-t_vers t_rele t_cust filler1
-7.6 a
-7.6 a
-drop table t1;
-create table t1 (
-pk int(11) not null auto_increment,
-a int(11) not null default '0',
-b int(11) not null default '0',
-c int(11) not null default '0',
-filler1 datetime, filler2 varchar(15),
-filler3 longtext,
-kp1 varchar(4), kp2 varchar(7),
-kp3 varchar(2), kp4 varchar(4),
-kp5 varchar(7),
-filler4 char(1),
-primary key (pk),
-key idx1(a,b,c),
-key idx2(c),
-key idx3(kp1,kp2,kp3,kp4,kp5)
-) default charset=latin1;
-set @fill=NULL;
-SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND
-kp1='279' AND kp2='ELM0678' AND kp3='6' AND kp4='10' AND kp5 = 'R ';
-COUNT(*)
-1
-drop table t1;
-create table t1
-(
-key1 int not null,
-key2 int not null default 0,
-key3 int not null default 0
-);
-insert into t1(key1) values (1),(2),(3),(4),(5),(6),(7),(8);
-set @d=8;
-insert into t1 (key1) select key1+@d from t1;
-set @d=@d*2;
-insert into t1 (key1) select key1+@d from t1;
-set @d=@d*2;
-insert into t1 (key1) select key1+@d from t1;
-set @d=@d*2;
-insert into t1 (key1) select key1+@d from t1;
-set @d=@d*2;
-insert into t1 (key1) select key1+@d from t1;
-set @d=@d*2;
-insert into t1 (key1) select key1+@d from t1;
-set @d=@d*2;
-insert into t1 (key1) select key1+@d from t1;
-set @d=@d*2;
-alter table t1 add index i2(key2);
-alter table t1 add index i3(key3);
-update t1 set key2=key1,key3=key1;
-explain select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
-id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 index_merge i2,i3 i3,i2 4,4 NULL 9 Using sort_union(i3,i2); Using where
-select * from t1 where (key3 > 30 and key3<35) or (key2 >32 and key2 < 40);
-key1 key2 key3
-31 31 31
-32 32 32
-33 33 33
-34 34 34
-35 35 35
-36 36 36
-37 37 37
-38 38 38
-39 39 39
-drop table t1;
#---------------- 2-sweeps read Index merge test 2 -------------------------------
SET SESSION STORAGE_ENGINE = InnoDB;
drop table if exists t1;
diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result
index c639b20de91..1be96da5c7d 100644
--- a/mysql-test/r/index_merge_myisam.result
+++ b/mysql-test/r/index_merge_myisam.result
@@ -341,9 +341,7 @@ drop table t4;
create table t4 (a int);
insert into t4 values (1),(4),(3);
set @save_join_buffer_size=@@join_buffer_size;
-set join_buffer_size= 4000;
-Warnings:
-Warning 1292 Truncated incorrect join_buffer_size value: '4000'
+set join_buffer_size= 4096;
explain select max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.key5 + B.key5)
from t0 as A force index(i1,i2), t0 as B force index (i1,i2)
where (A.key1 < 500000 or A.key2 < 3)
@@ -1421,21 +1419,20 @@ drop table t1;
#
select @@optimizer_switch;
@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
set optimizer_switch='index_merge=off,index_merge_union=off';
select @@optimizer_switch;
@@optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
set optimizer_switch='index_merge_union=on';
select @@optimizer_switch;
@@optimizer_switch
-index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
set optimizer_switch='default,index_merge_sort_union=off';
select @@optimizer_switch;
@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=on
set optimizer_switch=4;
-ERROR 42000: Variable 'optimizer_switch' can't be set to the value of '4'
set optimizer_switch=NULL;
ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL'
set optimizer_switch='default,index_merge';
@@ -1460,21 +1457,21 @@ set optimizer_switch=default;
set optimizer_switch='index_merge=off,index_merge_union=off,default';
select @@optimizer_switch;
@@optimizer_switch
-index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on
+index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
set optimizer_switch=default;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
set @@global.optimizer_switch=default;
select @@global.optimizer_switch;
@@global.optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
#
# Check index_merge's @@optimizer_switch flags
#
select @@optimizer_switch;
@@optimizer_switch
-index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, c int, filler char(100),
@@ -1584,5 +1581,5 @@ id select_type table type possible_keys key key_len ref rows Extra
set optimizer_switch=default;
show variables like 'optimizer_switch';
Variable_name Value
-optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on
+optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
drop table t0, t1;
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 9a75e478264..736f42df996 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -9,14 +9,16 @@ 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 performance_schema utf8 utf8_general_ci NULL
+def test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata;
schema_name
information_schema
mtr
mysql
+performance_schema
test
show databases like 't%';
Database (t%)
@@ -26,6 +28,7 @@ Database
information_schema
mtr
mysql
+performance_schema
test
show databases where `database` = 't%';
Database
@@ -39,8 +42,7 @@ insert into t5 values (10);
create view v1 (c) as
SELECT table_name FROM information_schema.TABLES
WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND
-table_name<>'ndb_binlog_index' AND
-table_name<>'ndb_apply_status';
+table_name not like 'ndb_%' AND table_name not like 'innodb_%';
select * from v1;
c
CHARACTER_SETS
@@ -54,6 +56,7 @@ FILES
GLOBAL_STATUS
GLOBAL_VARIABLES
KEY_COLUMN_USAGE
+PARAMETERS
PARTITIONS
PLUGINS
PROCESSLIST
@@ -66,6 +69,7 @@ SESSION_STATUS
SESSION_VARIABLES
STATISTICS
TABLES
+TABLESPACES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
@@ -104,6 +108,7 @@ inner join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
c table_name
TABLES TABLES
+TABLESPACES TABLESPACES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TRIGGERS TRIGGERS
@@ -123,6 +128,7 @@ left join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
c table_name
TABLES TABLES
+TABLESPACES TABLESPACES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TRIGGERS TRIGGERS
@@ -142,6 +148,7 @@ right join information_schema.TABLES v2 on (v1.c=v2.table_name)
where v1.c like "t%";
c table_name
TABLES TABLES
+TABLESPACES TABLESPACES
TABLE_CONSTRAINTS TABLE_CONSTRAINTS
TABLE_PRIVILEGES TABLE_PRIVILEGES
TRIGGERS TRIGGERS
@@ -163,7 +170,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
@@ -190,7 +197,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
@@ -360,6 +367,7 @@ c
information_schema
mtr
mysql
+performance_schema
test
explain select * from v0;
id select_type table type possible_keys key key_len ref rows Extra
@@ -395,11 +403,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;
@@ -407,38 +415,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%';
@@ -461,17 +469,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
@@ -492,13 +500,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;
@@ -593,7 +601,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)
@@ -629,6 +637,7 @@ COLLATIONS SYSTEM VIEW MEMORY
show tables from information_schema like "T%";
Tables_in_information_schema (T%)
TABLES
+TABLESPACES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
@@ -638,11 +647,12 @@ use information_schema;
show full tables like "T%";
Tables_in_information_schema (T%) Table_type
TABLES SYSTEM VIEW
+TABLESPACES SYSTEM VIEW
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
@@ -650,6 +660,7 @@ use information_schema;
show tables like "T%";
Tables_in_information_schema (T%)
TABLES
+TABLESPACES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
@@ -766,17 +777,20 @@ table_schema table_name column_name
information_schema COLUMNS COLUMN_DEFAULT
information_schema COLUMNS COLUMN_TYPE
information_schema EVENTS EVENT_DEFINITION
+information_schema PARAMETERS DTD_IDENTIFIER
information_schema PARTITIONS PARTITION_EXPRESSION
information_schema PARTITIONS SUBPARTITION_EXPRESSION
information_schema PARTITIONS PARTITION_DESCRIPTION
information_schema PLUGINS PLUGIN_DESCRIPTION
information_schema PROCESSLIST INFO
+information_schema ROUTINES DTD_IDENTIFIER
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
select table_name, column_name, data_type from information_schema.columns
-where data_type = 'datetime';
+where data_type = 'datetime' and table_name not like 'innodb_%';
table_name column_name data_type
EVENTS EXECUTE_AT datetime
EVENTS STARTS datetime
@@ -850,9 +864,12 @@ VIEWS TABLE_NAME select
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
-SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA;
+SELECT table_schema, count(*) FROM information_schema.TABLES WHERE
+table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest')
+AND table_name not like 'ndb%' AND table_name not like 'innodb_%'
+GROUP BY TABLE_SCHEMA;
table_schema count(*)
-information_schema 28
+information_schema 30
mysql 22
create table t1 (i int, j int);
create trigger trg1 before insert on t1 for each row
@@ -892,17 +909,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;
@@ -920,14 +937,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'
@@ -936,12 +953,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'
@@ -952,10 +969,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'
@@ -963,22 +980,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'
@@ -1174,8 +1191,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;
@@ -1224,92 +1241,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%'
- );
-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%'
- );
-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
@@ -1374,6 +1305,7 @@ from information_schema.columns c2 where
c2.table_schema='information_schema' and
(c2.column_type = 'varchar(7)' or c2.column_type = 'varchar(20)')
group by c2.column_type order by num limit 1)
+and t.table_name not like 'innodb_%'
group by t.table_name order by num1, t.table_name;
table_name group_concat(t.table_schema, '.', t.table_name) num1
CHARACTER_SETS information_schema.CHARACTER_SETS 1
@@ -1387,6 +1319,7 @@ FILES information_schema.FILES 1
GLOBAL_STATUS information_schema.GLOBAL_STATUS 1
GLOBAL_VARIABLES information_schema.GLOBAL_VARIABLES 1
KEY_COLUMN_USAGE information_schema.KEY_COLUMN_USAGE 1
+PARAMETERS information_schema.PARAMETERS 1
PARTITIONS information_schema.PARTITIONS 1
PLUGINS information_schema.PLUGINS 1
PROCESSLIST information_schema.PROCESSLIST 1
@@ -1399,6 +1332,7 @@ SESSION_STATUS information_schema.SESSION_STATUS 1
SESSION_VARIABLES information_schema.SESSION_VARIABLES 1
STATISTICS information_schema.STATISTICS 1
TABLES information_schema.TABLES 1
+TABLESPACES information_schema.TABLESPACES 1
TABLE_CONSTRAINTS information_schema.TABLE_CONSTRAINTS 1
TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
TRIGGERS information_schema.TRIGGERS 1
@@ -1552,7 +1486,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
@@ -1570,7 +1504,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';
@@ -1726,3 +1660,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_frm_only; 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 2e3fa7f4acd..9b6a6e4b066 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;
+show tables where Tables_in_information_schema NOT LIKE 'Innodb%';
Tables_in_information_schema
CHARACTER_SETS
COLLATIONS
@@ -16,6 +16,7 @@ FILES
GLOBAL_STATUS
GLOBAL_VARIABLES
KEY_COLUMN_USAGE
+PARAMETERS
PARTITIONS
PLUGINS
PROCESSLIST
@@ -28,6 +29,7 @@ SESSION_STATUS
SESSION_VARIABLES
STATISTICS
TABLES
+TABLESPACES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
@@ -36,6 +38,7 @@ VIEWS
show tables from INFORMATION_SCHEMA like 'T%';
Tables_in_information_schema (T%)
TABLES
+TABLESPACES
TABLE_CONSTRAINTS
TABLE_PRIVILEGES
TRIGGERS
@@ -119,12 +122,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 +155,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 +176,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 +208,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_parameters.result b/mysql-test/r/information_schema_parameters.result
new file mode 100644
index 00000000000..db04f5c0bd3
--- /dev/null
+++ b/mysql-test/r/information_schema_parameters.result
@@ -0,0 +1,457 @@
+# ========== parameters.1 ==========
+USE INFORMATION_SCHEMA;
+SHOW CREATE TABLE INFORMATION_SCHEMA.PARAMETERS;
+Table Create Table
+PARAMETERS CREATE TEMPORARY TABLE `PARAMETERS` (
+ `SPECIFIC_CATALOG` varchar(512) NOT NULL DEFAULT '',
+ `SPECIFIC_SCHEMA` varchar(64) NOT NULL DEFAULT '',
+ `SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '',
+ `ORDINAL_POSITION` int(21) NOT NULL DEFAULT '0',
+ `PARAMETER_MODE` varchar(5) DEFAULT NULL,
+ `PARAMETER_NAME` varchar(64) DEFAULT NULL,
+ `DATA_TYPE` varchar(64) NOT NULL DEFAULT '',
+ `CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL,
+ `CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL,
+ `NUMERIC_PRECISION` int(21) DEFAULT NULL,
+ `NUMERIC_SCALE` int(21) DEFAULT NULL,
+ `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL,
+ `COLLATION_NAME` varchar(64) DEFAULT NULL,
+ `DTD_IDENTIFIER` longtext NOT NULL,
+ `ROUTINE_TYPE` varchar(9) NOT NULL DEFAULT ''
+) DEFAULT CHARSET=utf8
+SELECT * FROM information_schema.columns
+WHERE table_schema = 'information_schema'
+ AND table_name = 'parameters'
+ORDER BY ordinal_position;
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME SPECIFIC_CATALOG
+ORDINAL_POSITION 1
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 512
+CHARACTER_OCTET_LENGTH 1536
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(512)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME SPECIFIC_SCHEMA
+ORDINAL_POSITION 2
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME SPECIFIC_NAME
+ORDINAL_POSITION 3
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME ORDINAL_POSITION
+ORDINAL_POSITION 4
+COLUMN_DEFAULT 0
+IS_NULLABLE NO
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME PARAMETER_MODE
+ORDINAL_POSITION 5
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 5
+CHARACTER_OCTET_LENGTH 15
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(5)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME PARAMETER_NAME
+ORDINAL_POSITION 6
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME DATA_TYPE
+ORDINAL_POSITION 7
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME CHARACTER_MAXIMUM_LENGTH
+ORDINAL_POSITION 8
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME CHARACTER_OCTET_LENGTH
+ORDINAL_POSITION 9
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME NUMERIC_PRECISION
+ORDINAL_POSITION 10
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME NUMERIC_SCALE
+ORDINAL_POSITION 11
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME CHARACTER_SET_NAME
+ORDINAL_POSITION 12
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME COLLATION_NAME
+ORDINAL_POSITION 13
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME DTD_IDENTIFIER
+ORDINAL_POSITION 14
+COLUMN_DEFAULT NULL
+IS_NULLABLE NO
+DATA_TYPE longtext
+CHARACTER_MAXIMUM_LENGTH 4294967295
+CHARACTER_OCTET_LENGTH 4294967295
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE longtext
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME parameters
+COLUMN_NAME ROUTINE_TYPE
+ORDINAL_POSITION 15
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 9
+CHARACTER_OCTET_LENGTH 27
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(9)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+DESCRIBE INFORMATION_SCHEMA.PARAMETERS;
+Field Type Null Key Default Extra
+SPECIFIC_CATALOG varchar(512) NO
+SPECIFIC_SCHEMA varchar(64) NO
+SPECIFIC_NAME varchar(64) NO
+ORDINAL_POSITION int(21) NO 0
+PARAMETER_MODE varchar(5) YES NULL
+PARAMETER_NAME varchar(64) YES NULL
+DATA_TYPE varchar(64) NO
+CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
+CHARACTER_OCTET_LENGTH int(21) YES NULL
+NUMERIC_PRECISION int(21) YES NULL
+NUMERIC_SCALE int(21) YES NULL
+CHARACTER_SET_NAME varchar(64) YES NULL
+COLLATION_NAME varchar(64) YES NULL
+DTD_IDENTIFIER longtext NO NULL
+ROUTINE_TYPE varchar(9) NO
+# ========== parameters.2 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func1 (s char(20) RETURNS CHAR(50)
+RETURN CONCAT('Hello', ,s,'!');
+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 'RETURNS CHAR(50)
+RETURN CONCAT('Hello', ,s,'!')' at line 1
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func1';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+# ========== parameters.3 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func1 (s char(20)) RETURNS CHAR(50)
+RETURN CONCAT('Hello, ',s,'!');
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func1';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func1 0 NULL NULL char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) FUNCTION
+def i_s_parameters_test test_func1 1 IN s char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) FUNCTION
+DROP FUNCTION test_func1;
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func1';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+# ========== parameters.4 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE PROCEDURE testproc (OUT param1 INT)
+BEGIN
+SELECT 2+2 as param1;
+END;
+//
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'testproc';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test testproc 1 OUT param1 int NULL NULL 10 0 NULL NULL int(11) PROCEDURE
+# ========== parameters.5 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE PROCEDURE test_proc(INOUT P INT) SET @x=P*2;
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_proc';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_proc 1 INOUT P int NULL NULL 10 0 NULL NULL int(11) PROCEDURE
+# ========== parameters.6 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE PROCEDURE test_proc(OUT p VARCHAR(10)) SET P='test';
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_proc';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_proc 1 OUT p varchar 10 10 NULL NULL latin1 latin1_swedish_ci varchar(10) PROCEDURE
+# ========== parameters.7 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func1 (s char(20), t char(20)) RETURNS CHAR(40)
+RETURN CONCAT(s,t);
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func1';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func1 0 NULL NULL char 40 40 NULL NULL latin1 latin1_swedish_ci char(40) FUNCTION
+def i_s_parameters_test test_func1 1 IN s char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) FUNCTION
+def i_s_parameters_test test_func1 2 IN t char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) FUNCTION
+# ========== parameters.8 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func1 (s char(20)) RETURNS CHAR(50)
+RETURN CONCAT('Hello, ',s,'!');
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func1';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func1 0 NULL NULL char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) FUNCTION
+def i_s_parameters_test test_func1 1 IN s char 20 20 NULL NULL latin1 latin1_swedish_ci char(20) FUNCTION
+# ========== parameters.9 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func2 (s int) RETURNS INT RETURN s*2;
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func2';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func2 0 NULL NULL int NULL NULL 10 0 NULL NULL int(11) FUNCTION
+def i_s_parameters_test test_func2 1 IN s int NULL NULL 10 0 NULL NULL int(11) FUNCTION
+# ========== parameters.10 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func5 (s date) RETURNS TIMESTAMP
+RETURN CURRENT_TIMESTAMP;
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func5';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func5 0 NULL NULL timestamp NULL NULL NULL NULL NULL NULL timestamp FUNCTION
+def i_s_parameters_test test_func5 1 IN s date NULL NULL NULL NULL NULL NULL date FUNCTION
+# ========== parameters.11 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func5 (s date) RETURNS TIMESTAMP
+RETURN CURRENT_TIMESTAMP;
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func5';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func5 0 NULL NULL timestamp NULL NULL NULL NULL NULL NULL timestamp FUNCTION
+def i_s_parameters_test test_func5 1 IN s date NULL NULL NULL NULL NULL NULL date FUNCTION
+ALTER FUNCTION test_func5 COMMENT 'new comment added';
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func5';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func5 0 NULL NULL timestamp NULL NULL NULL NULL NULL NULL timestamp FUNCTION
+def i_s_parameters_test test_func5 1 IN s date NULL NULL NULL NULL NULL NULL date FUNCTION
+# ========== parameters.12 ==========
+DROP DATABASE IF EXISTS i_s_parameters_test;
+CREATE DATABASE i_s_parameters_test CHARACTER SET utf8;
+USE i_s_parameters_test;
+CREATE FUNCTION test_func5 (s CHAR(20)) RETURNS VARCHAR(30)
+RETURN CONCAT('XYZ, ' ,s);
+SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
+WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'test_func5';
+SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
+def i_s_parameters_test test_func5 0 NULL NULL varchar 30 90 NULL NULL utf8 utf8_general_ci varchar(30) FUNCTION
+def i_s_parameters_test test_func5 1 IN s char 20 60 NULL NULL utf8 utf8_general_ci char(20) FUNCTION
+DROP DATABASE i_s_parameters_test;
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/information_schema_routines.result b/mysql-test/r/information_schema_routines.result
new file mode 100644
index 00000000000..664ec6bf748
--- /dev/null
+++ b/mysql-test/r/information_schema_routines.result
@@ -0,0 +1,737 @@
+# ========== routines.1 ==========
+USE INFORMATION_SCHEMA;
+SHOW CREATE TABLE INFORMATION_SCHEMA.ROUTINES;
+Table Create Table
+ROUTINES CREATE TEMPORARY TABLE `ROUTINES` (
+ `SPECIFIC_NAME` varchar(64) NOT NULL DEFAULT '',
+ `ROUTINE_CATALOG` varchar(512) NOT NULL DEFAULT '',
+ `ROUTINE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
+ `ROUTINE_NAME` varchar(64) NOT NULL DEFAULT '',
+ `ROUTINE_TYPE` varchar(9) NOT NULL DEFAULT '',
+ `DATA_TYPE` varchar(64) NOT NULL DEFAULT '',
+ `CHARACTER_MAXIMUM_LENGTH` int(21) DEFAULT NULL,
+ `CHARACTER_OCTET_LENGTH` int(21) DEFAULT NULL,
+ `NUMERIC_PRECISION` int(21) DEFAULT NULL,
+ `NUMERIC_SCALE` int(21) DEFAULT NULL,
+ `CHARACTER_SET_NAME` varchar(64) DEFAULT NULL,
+ `COLLATION_NAME` varchar(64) DEFAULT NULL,
+ `DTD_IDENTIFIER` longtext,
+ `ROUTINE_BODY` varchar(8) NOT NULL DEFAULT '',
+ `ROUTINE_DEFINITION` longtext,
+ `EXTERNAL_NAME` varchar(64) DEFAULT NULL,
+ `EXTERNAL_LANGUAGE` varchar(64) DEFAULT NULL,
+ `PARAMETER_STYLE` varchar(8) NOT NULL DEFAULT '',
+ `IS_DETERMINISTIC` varchar(3) NOT NULL DEFAULT '',
+ `SQL_DATA_ACCESS` varchar(64) NOT NULL DEFAULT '',
+ `SQL_PATH` varchar(64) DEFAULT NULL,
+ `SECURITY_TYPE` varchar(7) NOT NULL DEFAULT '',
+ `CREATED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `LAST_ALTERED` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `SQL_MODE` varchar(8192) NOT NULL DEFAULT '',
+ `ROUTINE_COMMENT` longtext NOT NULL,
+ `DEFINER` varchar(77) NOT NULL DEFAULT '',
+ `CHARACTER_SET_CLIENT` varchar(32) NOT NULL DEFAULT '',
+ `COLLATION_CONNECTION` varchar(32) NOT NULL DEFAULT '',
+ `DATABASE_COLLATION` varchar(32) NOT NULL DEFAULT ''
+) DEFAULT CHARSET=utf8
+SELECT * FROM information_schema.columns
+WHERE table_schema = 'information_schema'
+ AND table_name = 'routines'
+ORDER BY ordinal_position;
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME SPECIFIC_NAME
+ORDINAL_POSITION 1
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME ROUTINE_CATALOG
+ORDINAL_POSITION 2
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 512
+CHARACTER_OCTET_LENGTH 1536
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(512)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME ROUTINE_SCHEMA
+ORDINAL_POSITION 3
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME ROUTINE_NAME
+ORDINAL_POSITION 4
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME ROUTINE_TYPE
+ORDINAL_POSITION 5
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 9
+CHARACTER_OCTET_LENGTH 27
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(9)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME DATA_TYPE
+ORDINAL_POSITION 6
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME CHARACTER_MAXIMUM_LENGTH
+ORDINAL_POSITION 7
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME CHARACTER_OCTET_LENGTH
+ORDINAL_POSITION 8
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME NUMERIC_PRECISION
+ORDINAL_POSITION 9
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME NUMERIC_SCALE
+ORDINAL_POSITION 10
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE int
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION 10
+NUMERIC_SCALE 0
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE int(21)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME CHARACTER_SET_NAME
+ORDINAL_POSITION 11
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME COLLATION_NAME
+ORDINAL_POSITION 12
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME DTD_IDENTIFIER
+ORDINAL_POSITION 13
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE longtext
+CHARACTER_MAXIMUM_LENGTH 4294967295
+CHARACTER_OCTET_LENGTH 4294967295
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE longtext
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME ROUTINE_BODY
+ORDINAL_POSITION 14
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 8
+CHARACTER_OCTET_LENGTH 24
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(8)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME ROUTINE_DEFINITION
+ORDINAL_POSITION 15
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE longtext
+CHARACTER_MAXIMUM_LENGTH 4294967295
+CHARACTER_OCTET_LENGTH 4294967295
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE longtext
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME EXTERNAL_NAME
+ORDINAL_POSITION 16
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME EXTERNAL_LANGUAGE
+ORDINAL_POSITION 17
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME PARAMETER_STYLE
+ORDINAL_POSITION 18
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 8
+CHARACTER_OCTET_LENGTH 24
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(8)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME IS_DETERMINISTIC
+ORDINAL_POSITION 19
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 3
+CHARACTER_OCTET_LENGTH 9
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(3)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME SQL_DATA_ACCESS
+ORDINAL_POSITION 20
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME SQL_PATH
+ORDINAL_POSITION 21
+COLUMN_DEFAULT NULL
+IS_NULLABLE YES
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 64
+CHARACTER_OCTET_LENGTH 192
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(64)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME SECURITY_TYPE
+ORDINAL_POSITION 22
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 7
+CHARACTER_OCTET_LENGTH 21
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(7)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME CREATED
+ORDINAL_POSITION 23
+COLUMN_DEFAULT 0000-00-00 00:00:00
+IS_NULLABLE NO
+DATA_TYPE datetime
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE datetime
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME LAST_ALTERED
+ORDINAL_POSITION 24
+COLUMN_DEFAULT 0000-00-00 00:00:00
+IS_NULLABLE NO
+DATA_TYPE datetime
+CHARACTER_MAXIMUM_LENGTH NULL
+CHARACTER_OCTET_LENGTH NULL
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME NULL
+COLLATION_NAME NULL
+COLUMN_TYPE datetime
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME SQL_MODE
+ORDINAL_POSITION 25
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 8192
+CHARACTER_OCTET_LENGTH 24576
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(8192)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME ROUTINE_COMMENT
+ORDINAL_POSITION 26
+COLUMN_DEFAULT NULL
+IS_NULLABLE NO
+DATA_TYPE longtext
+CHARACTER_MAXIMUM_LENGTH 4294967295
+CHARACTER_OCTET_LENGTH 4294967295
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE longtext
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME DEFINER
+ORDINAL_POSITION 27
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 77
+CHARACTER_OCTET_LENGTH 231
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(77)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME CHARACTER_SET_CLIENT
+ORDINAL_POSITION 28
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 32
+CHARACTER_OCTET_LENGTH 96
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(32)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME COLLATION_CONNECTION
+ORDINAL_POSITION 29
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 32
+CHARACTER_OCTET_LENGTH 96
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(32)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+TABLE_CATALOG def
+TABLE_SCHEMA information_schema
+TABLE_NAME routines
+COLUMN_NAME DATABASE_COLLATION
+ORDINAL_POSITION 30
+COLUMN_DEFAULT
+IS_NULLABLE NO
+DATA_TYPE varchar
+CHARACTER_MAXIMUM_LENGTH 32
+CHARACTER_OCTET_LENGTH 96
+NUMERIC_PRECISION NULL
+NUMERIC_SCALE NULL
+CHARACTER_SET_NAME utf8
+COLLATION_NAME utf8_general_ci
+COLUMN_TYPE varchar(32)
+COLUMN_KEY
+EXTRA
+PRIVILEGES #
+COLUMN_COMMENT
+DESCRIBE INFORMATION_SCHEMA.ROUTINES;
+Field Type Null Key Default Extra
+SPECIFIC_NAME varchar(64) NO
+ROUTINE_CATALOG varchar(512) NO
+ROUTINE_SCHEMA varchar(64) NO
+ROUTINE_NAME varchar(64) NO
+ROUTINE_TYPE varchar(9) NO
+DATA_TYPE varchar(64) NO
+CHARACTER_MAXIMUM_LENGTH int(21) YES NULL
+CHARACTER_OCTET_LENGTH int(21) YES NULL
+NUMERIC_PRECISION int(21) YES NULL
+NUMERIC_SCALE int(21) YES NULL
+CHARACTER_SET_NAME varchar(64) YES NULL
+COLLATION_NAME varchar(64) YES NULL
+DTD_IDENTIFIER longtext YES NULL
+ROUTINE_BODY varchar(8) NO
+ROUTINE_DEFINITION longtext YES NULL
+EXTERNAL_NAME varchar(64) YES NULL
+EXTERNAL_LANGUAGE varchar(64) YES NULL
+PARAMETER_STYLE varchar(8) NO
+IS_DETERMINISTIC varchar(3) NO
+SQL_DATA_ACCESS varchar(64) NO
+SQL_PATH varchar(64) YES NULL
+SECURITY_TYPE varchar(7) NO
+CREATED datetime NO 0000-00-00 00:00:00
+LAST_ALTERED datetime NO 0000-00-00 00:00:00
+SQL_MODE varchar(8192) NO
+ROUTINE_COMMENT longtext NO NULL
+DEFINER varchar(77) NO
+CHARACTER_SET_CLIENT varchar(32) NO
+COLLATION_CONNECTION varchar(32) NO
+DATABASE_COLLATION varchar(32) NO
+# ========== routines.2 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test;
+USE i_s_routines_test;
+CREATE FUNCTION test_func1 (s char(20) RETURNS CHAR(50)
+RETURN CONCAT('Hello', ,s,'!');
+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 'RETURNS CHAR(50)
+RETURN CONCAT('Hello', ,s,'!')' at line 1
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func1';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+# ========== routines.3 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test;
+USE i_s_routines_test;
+CREATE FUNCTION test_func1 (s char(20)) RETURNS CHAR(50)
+RETURN CONCAT('Hello, ',s,'!');
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func1';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+test_func1 def i_s_routines_test test_func1 FUNCTION char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) SQL RETURN CONCAT('Hello, ',s,'!') NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+DROP FUNCTION test_func1;
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func1';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+# ========== routines.4 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test;
+USE i_s_routines_test;
+CREATE PROCEDURE testproc (OUT param1 INT)
+BEGIN
+SELECT 2+2 as param1;
+END;
+//
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'testproc';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+testproc def i_s_routines_test testproc PROCEDURE NULL NULL NULL NULL NULL NULL NULL SQL BEGIN
+SELECT 2+2 as param1;
+END NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+# ========== routines.5 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test;
+USE i_s_routines_test;
+CREATE FUNCTION test_func1 (s char(20)) RETURNS CHAR(50)
+RETURN CONCAT('Hello, ',s,'!');
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func1';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+test_func1 def i_s_routines_test test_func1 FUNCTION char 50 50 NULL NULL latin1 latin1_swedish_ci char(50) SQL RETURN CONCAT('Hello, ',s,'!') NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+# ========== routines.6 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test;
+USE i_s_routines_test;
+CREATE FUNCTION test_func2 (s int) RETURNS INT RETURN s*2;
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func2';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+test_func2 def i_s_routines_test test_func2 FUNCTION int NULL NULL 10 0 NULL NULL int(11) SQL RETURN s*2 NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+# ========== routines.7 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test;
+USE i_s_routines_test;
+CREATE FUNCTION test_func5 (s date) RETURNS TIMESTAMP
+RETURN CURRENT_TIMESTAMP;
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func5';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+test_func5 def i_s_routines_test test_func5 FUNCTION timestamp NULL NULL NULL NULL NULL NULL timestamp SQL RETURN CURRENT_TIMESTAMP NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+# ========== routines.8 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test;
+USE i_s_routines_test;
+CREATE FUNCTION test_func5 (s date) RETURNS TIMESTAMP
+RETURN CURRENT_TIMESTAMP;
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func5';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+test_func5 def i_s_routines_test test_func5 FUNCTION timestamp NULL NULL NULL NULL NULL NULL timestamp SQL RETURN CURRENT_TIMESTAMP NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+ALTER FUNCTION test_func5 COMMENT 'new comment added';
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func5';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+test_func5 def i_s_routines_test test_func5 FUNCTION timestamp NULL NULL NULL NULL NULL NULL timestamp SQL RETURN CURRENT_TIMESTAMP NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> new comment added root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+# ========== routines.9 ==========
+DROP DATABASE IF EXISTS i_s_routines_test;
+CREATE DATABASE i_s_routines_test CHARACTER SET utf8;
+USE i_s_routines_test;
+CREATE FUNCTION test_func5 (s CHAR(20)) RETURNS VARCHAR(30)
+RETURN CONCAT('XYZ, ' ,s);
+SELECT * FROM INFORMATION_SCHEMA.ROUTINES
+WHERE ROUTINE_SCHEMA = 'i_s_routines_test' AND ROUTINE_NAME = 'test_func5';
+SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE CHARACTER_SET_NAME COLLATION_NAME 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
+test_func5 def i_s_routines_test test_func5 FUNCTION varchar 30 90 NULL NULL utf8 utf8_general_ci varchar(30) SQL RETURN CONCAT('XYZ, ' ,s) NULL NULL SQL NO CONTAINS SQL NULL DEFINER <created> <modified> root@localhost latin1 latin1_swedish_ci utf8_general_ci
+DROP DATABASE i_s_routines_test;
diff --git a/mysql-test/r/innodb-autoinc.result b/mysql-test/r/innodb-autoinc.result
index fe87e11c9ec..abb8f3da072 100644
--- a/mysql-test/r/innodb-autoinc.result
+++ b/mysql-test/r/innodb-autoinc.result
@@ -1111,82 +1111,18 @@ c1 c2
3 innodb
4 NULL
DROP TABLE t1;
-CREATE TABLE t1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
-CREATE INDEX i1 on t1(c2);
-SHOW CREATE TABLE t1;
+CREATE TABLE T1 (c1 INT AUTO_INCREMENT, c2 INT, PRIMARY KEY(c1)) AUTO_INCREMENT=10 ENGINE=InnoDB;
+CREATE INDEX i1 on T1(c2);
+SHOW CREATE TABLE T1;
Table Create Table
-t1 CREATE TABLE `t1` (
+T1 CREATE TABLE `T1` (
`c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`),
KEY `i1` (`c2`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
-INSERT INTO t1 (c2) values (0);
-SELECT * FROM t1;
+INSERT INTO T1 (c2) values (0);
+SELECT * FROM T1;
c1 c2
10 0
-DROP TABLE t1;
-DROP TABLE IF EXISTS t1;
-Warnings:
-Note 1051 Unknown table 't1'
-CREATE TABLE t1(C1 DOUBLE AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
-INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
-INSERT INTO t1(C2) VALUES ('innodb');
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `C1` double NOT NULL AUTO_INCREMENT,
- `C2` char(10) DEFAULT NULL,
- PRIMARY KEY (`C1`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
-DROP TABLE t1;
-CREATE TABLE t1(C1 FLOAT AUTO_INCREMENT KEY, C2 CHAR(10)) ENGINE=InnoDB;
-INSERT INTO t1(C1, C2) VALUES (1, 'innodb'), (3, 'innodb');
-INSERT INTO t1(C2) VALUES ('innodb');
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `C1` float NOT NULL AUTO_INCREMENT,
- `C2` char(10) DEFAULT NULL,
- PRIMARY KEY (`C1`)
-) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
-DROP TABLE t1;
-DROP TABLE IF EXISTS t1;
-Warnings:
-Note 1051 Unknown table 't1'
-CREATE TABLE t1 (c1 INT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
-INSERT INTO t1 SET c1 = 1;
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
-INSERT INTO t1 SET c1 = 2;
-INSERT INTO t1 SET c1 = -1;
-SELECT * FROM t1;
-c1
--1
-1
-2
-INSERT INTO t1 SET c1 = -1;
-Got one of the listed errors
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
-REPLACE INTO t1 VALUES (-1);
-SELECT * FROM t1;
-c1
--1
-1
-2
-SHOW CREATE TABLE t1;
-Table Create Table
-t1 CREATE TABLE `t1` (
- `c1` int(11) NOT NULL AUTO_INCREMENT,
- PRIMARY KEY (`c1`)
-) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
-DROP TABLE t1;
+DROP TABLE T1;
diff --git a/mysql-test/r/innodb-consistent.result b/mysql-test/r/innodb-consistent.result
new file mode 100644
index 00000000000..9115791b99c
--- /dev/null
+++ b/mysql-test/r/innodb-consistent.result
@@ -0,0 +1,35 @@
+drop table if exists t1;
+set session transaction isolation level read committed;
+create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
+create table t2 like t1;
+insert into t2 values (1),(2),(3),(4),(5),(6),(7);
+set autocommit=0;
+begin;
+replace into t1 select * from t2;
+set session transaction isolation level read committed;
+set autocommit=0;
+delete from t2 where a=5;
+commit;
+delete from t2;
+commit;
+commit;
+begin;
+insert into t1 select * from t2;
+set session transaction isolation level read committed;
+set autocommit=0;
+delete from t2 where a=5;
+commit;
+delete from t2;
+commit;
+commit;
+select * from t1;
+a
+1
+2
+3
+4
+5
+6
+7
+drop table t1;
+drop table t2;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index b6602c9cfaf..6cee55482e3 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1508,7 +1508,7 @@ t2 CREATE TABLE `t2` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop index id2 on t2;
drop index id on t2;
-Got one of the listed errors
+ERROR HY000: Cannot drop index 'id': needed in a foreign key constraint
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -1766,9 +1766,10 @@ variable_value - @innodb_row_lock_time_max_orig
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
variable_value - @innodb_row_lock_time_avg_orig
0
+SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
show variables like "innodb_sync_spin_loops";
Variable_name Value
-innodb_sync_spin_loops 20
+innodb_sync_spin_loops 30
set global innodb_sync_spin_loops=1000;
show variables like "innodb_sync_spin_loops";
Variable_name Value
@@ -1781,13 +1782,13 @@ set global innodb_sync_spin_loops=20;
show variables like "innodb_sync_spin_loops";
Variable_name Value
innodb_sync_spin_loops 20
-SET @old_innodb_thread_concurrency= @@global.innodb_thread_concurrency;
+set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
show variables like "innodb_thread_concurrency";
Variable_name Value
-innodb_thread_concurrency 8
+innodb_thread_concurrency 0
set global innodb_thread_concurrency=1001;
Warnings:
-Warning 1292 Truncated incorrect thread_concurrency value: '1001'
+Warning 1292 Truncated incorrect innodb_thread_concurrency value: '1001'
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 1000
@@ -1799,7 +1800,6 @@ set global innodb_thread_concurrency=16;
show variables like "innodb_thread_concurrency";
Variable_name Value
innodb_thread_concurrency 16
-SET @@global.innodb_thread_concurrency= @old_innodb_thread_concurrency;
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 500
@@ -1809,7 +1809,7 @@ Variable_name Value
innodb_concurrency_tickets 1000
set global innodb_concurrency_tickets=0;
Warnings:
-Warning 1292 Truncated incorrect concurrency_tickets value: '0'
+Warning 1292 Truncated incorrect innodb_concurrency_tickets value: '0'
show variables like "innodb_concurrency_tickets";
Variable_name Value
innodb_concurrency_tickets 1
@@ -1970,7 +1970,7 @@ explain select count(*) from t1 where v between 'a' and 'a ' and v between 'a '
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref v v 13 const # Using where; Using index
alter table t1 add unique(v);
-ERROR 23000: Duplicate entry '{ ' for key 'v_2'
+ERROR 23000: Duplicate entry 'v' for key 'v_2'
alter table t1 add key(v);
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
qq
@@ -2377,6 +2377,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1 (v varchar(10), c char(10)) row_format=fixed;
+Warnings:
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -2721,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'
@@ -3086,7 +3088,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
drop table t1, t2, t3, t5, t6, t8, t9;
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
-ERROR HY000: Can't create table 'test.t1' (errno: -1)
+ERROR 42000: Incorrect column name 'DB_ROW_ID'
CREATE TABLE t1 (
a BIGINT(20) NOT NULL,
PRIMARY KEY (a)
@@ -3190,6 +3192,7 @@ t1 CREATE TABLE `t1` (
CONSTRAINT `t1_t2` FOREIGN KEY (`id`) REFERENCES `t2` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=349 DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
+set innodb_strict_mode=on;
CREATE TABLE t1 (
c01 CHAR(255), c02 CHAR(255), c03 CHAR(255), c04 CHAR(255),
c05 CHAR(255), c06 CHAR(255), c07 CHAR(255), c08 CHAR(255),
diff --git a/mysql-test/r/innodb_bug34300.result b/mysql-test/r/innodb_bug34300.result
index 03ae355de7b..ae9fee81ad7 100644
--- a/mysql-test/r/innodb_bug34300.result
+++ b/mysql-test/r/innodb_bug34300.result
@@ -1,9 +1,4 @@
-SELECT f4, f8 FROM bug34300;
f4 f8
xxx zzz
-ALTER TABLE bug34300 ADD COLUMN (f10 INT);
-SELECT f4, f8 FROM bug34300;
f4 f8
xxx zzz
-DROP TABLE bug34300;
-SET @@global.max_allowed_packet=default;
diff --git a/mysql-test/r/innodb_bug42101-nonzero.result b/mysql-test/r/innodb_bug42101-nonzero.result
index 277dfffdd35..f43cb9da239 100644
--- a/mysql-test/r/innodb_bug42101-nonzero.result
+++ b/mysql-test/r/innodb_bug42101-nonzero.result
@@ -1,5 +1,5 @@
set global innodb_commit_concurrency=0;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
1
@@ -16,7 +16,7 @@ select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
1
set global innodb_commit_concurrency=0;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '0'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
1
diff --git a/mysql-test/r/innodb_bug42101.result b/mysql-test/r/innodb_bug42101.result
index 805097ffe9d..4e3367d5a54 100644
--- a/mysql-test/r/innodb_bug42101.result
+++ b/mysql-test/r/innodb_bug42101.result
@@ -3,12 +3,12 @@ select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
0
set global innodb_commit_concurrency=1;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '1'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
0
set global innodb_commit_concurrency=42;
-ERROR HY000: Incorrect arguments to SET
+ERROR 42000: Variable 'innodb_commit_concurrency' can't be set to the value of '42'
select @@innodb_commit_concurrency;
@@innodb_commit_concurrency
0
diff --git a/mysql-test/r/innodb_bug44369.result b/mysql-test/r/innodb_bug44369.result
index 9cf79aeffab..ff25c774aa2 100644
--- a/mysql-test/r/innodb_bug44369.result
+++ b/mysql-test/r/innodb_bug44369.result
@@ -1,14 +1,6 @@
create table bug44369 (DB_ROW_ID int) engine=innodb;
-ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
+ERROR 42000: Incorrect column name 'DB_ROW_ID'
create table bug44369 (db_row_id int) engine=innodb;
-ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
-show warnings;
-Level Code Message
-Warning 1005 Error creating table 'test/bug44369' with column name 'db_row_id'. 'db_row_id' is a reserved name. Please try to re-create the table with a different column name.
-Error 1005 Can't create table 'test.bug44369' (errno: -1)
+ERROR 42000: Incorrect column name 'db_row_id'
create table bug44369 (db_TRX_Id int) engine=innodb;
-ERROR HY000: Can't create table 'test.bug44369' (errno: -1)
-show warnings;
-Level Code Message
-Warning 1005 Error creating table 'test/bug44369' with column name 'db_TRX_Id'. 'db_TRX_Id' is a reserved name. Please try to re-create the table with a different column name.
-Error 1005 Can't create table 'test.bug44369' (errno: -1)
+ERROR 42000: Incorrect column name 'db_TRX_Id'
diff --git a/mysql-test/r/innodb_bug44571.result b/mysql-test/r/innodb_bug44571.result
new file mode 100644
index 00000000000..36374edcb3e
--- /dev/null
+++ b/mysql-test/r/innodb_bug44571.result
@@ -0,0 +1,9 @@
+CREATE TABLE bug44571 (foo INT) ENGINE=InnoDB;
+ALTER TABLE bug44571 CHANGE foo bar INT;
+ALTER TABLE bug44571 ADD INDEX bug44571b (foo);
+ERROR 42000: Key column 'foo' doesn't exist in table
+ALTER TABLE bug44571 ADD INDEX bug44571b (bar);
+ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
+CREATE INDEX bug44571b ON bug44571 (bar);
+ERROR HY000: Incorrect key file for table 'bug44571'; try to repair it
+DROP TABLE bug44571;
diff --git a/mysql-test/r/innodb_bug46000.result b/mysql-test/r/innodb_bug46000.result
index ccf7cc56859..c8e3db8d641 100644
--- a/mysql-test/r/innodb_bug46000.result
+++ b/mysql-test/r/innodb_bug46000.result
@@ -1,17 +1,19 @@
create table bug46000(`id` int,key `GEN_CLUST_INDEX`(`id`))engine=innodb;
-ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
+ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
create table bug46000(`id` int, key `GEN_clust_INDEX`(`id`))engine=innodb;
-ERROR HY000: Can't create table 'test.bug46000' (errno: -1)
+ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
show warnings;
Level Code Message
-Warning 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Error 1280 Incorrect index name 'GEN_CLUST_INDEX'
Error 1005 Can't create table 'test.bug46000' (errno: -1)
create table bug46000(id int) engine=innodb;
create index GEN_CLUST_INDEX on bug46000(id);
-ERROR HY000: Can't create table '#sql-temporary' (errno: -1)
+ERROR 42000: Incorrect index name 'GEN_CLUST_INDEX'
show warnings;
Level Code Message
-Warning 1005 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
-Error 1005 Can't create table '#sql-temporary' (errno: -1)
+Warning 1280 Cannot Create Index with name 'GEN_CLUST_INDEX'. The name is reserved for the system default primary index.
+Error 1280 Incorrect index name 'GEN_CLUST_INDEX'
+Error 1030 Got error -1 from storage engine
create index idx on bug46000(id);
drop table bug46000;
diff --git a/mysql-test/r/innodb_gis.result b/mysql-test/r/innodb_gis.result
index c6c775afc9f..0ce1ebe56ad 100644
--- a/mysql-test/r/innodb_gis.result
+++ b/mysql-test/r/innodb_gis.result
@@ -266,7 +266,7 @@ fid AsText(EndPoint(g))
107 POINT(40 10)
SELECT fid, GLength(g) FROM gis_line ORDER by fid;
fid GLength(g)
-105 24.142135623731
+105 24.14213562373095
106 40
107 30
SELECT fid, NumPoints(g) FROM gis_line ORDER by fid;
@@ -292,7 +292,7 @@ Note 1003 select astext(startpoint(`test`.`gis_line`.`g`)) AS `AsText(StartPoint
SELECT fid, AsText(Centroid(g)) FROM gis_polygon ORDER by fid;
fid AsText(Centroid(g))
108 POINT(15 15)
-109 POINT(25.4166666666667 25.4166666666667)
+109 POINT(25.416666666666668 25.416666666666668)
110 POINT(20 10)
SELECT fid, Area(g) FROM gis_polygon ORDER by fid;
fid Area(g)
@@ -326,8 +326,8 @@ fid IsClosed(g)
116 0
SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon ORDER by fid;
fid AsText(Centroid(g))
-117 POINT(55.5885277530424 17.426536064114)
-118 POINT(55.5885277530424 17.426536064114)
+117 POINT(55.58852775304245 17.426536064113982)
+118 POINT(55.58852775304245 17.426536064113982)
119 POINT(2 2)
SELECT fid, Area(g) FROM gis_multi_polygon ORDER by fid;
fid Area(g)
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..b322c5da73a 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -175,12 +175,12 @@ Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 4
original_value 1e+1111111111a
-f_double 1.79769313486232e+308
-f_float 3.40282e+38
+f_double 1.7976931348623157e308
+f_float 3.40282e38
f_double_7_2 99999.99
f_float_4_3 9.999
-f_double_u 1.79769313486232e+308
-f_float_u 3.40282e+38
+f_double_u 1.7976931348623157e308
+f_float_u 3.40282e38
f_double_15_1_u 99999999999999.9
f_float_3_1_u 99.9
set @value= "-1e+1111111111a";
@@ -204,8 +204,8 @@ Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 5
original_value -1e+1111111111a
-f_double -1.79769313486232e+308
-f_float -3.40282e+38
+f_double -1.7976931348623157e308
+f_float -3.40282e38
f_double_7_2 -99999.99
f_float_4_3 -9.999
f_double_u 0
@@ -227,13 +227,13 @@ Warning 1264 Out of range value for column 'f_double_15_1_u' at row 1
Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 6
-original_value 1e+111
-f_double 1e+111
-f_float 3.40282e+38
+original_value 1e111
+f_double 1e111
+f_float 3.40282e38
f_double_7_2 99999.99
f_float_4_3 9.999
-f_double_u 1e+111
-f_float_u 3.40282e+38
+f_double_u 1e111
+f_float_u 3.40282e38
f_double_15_1_u 99999999999999.9
f_float_3_1_u 99.9
set @value= -1e+111;
@@ -248,9 +248,9 @@ Warning 1264 Out of range value for column 'f_double_15_1_u' at row 1
Warning 1264 Out of range value for column 'f_float_3_1_u' at row 1
select * from t1 where number =last_insert_id();
number 7
-original_value -1e+111
-f_double -1e+111
-f_float -3.40282e+38
+original_value -1e111
+f_double -1e111
+f_float -3.40282e38
f_double_7_2 -99999.99
f_float_4_3 -9.999
f_double_u 0
@@ -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));
@@ -524,42 +524,36 @@ INSERT INTO t1(a,b) VALUES (1.25e-175, 1.25e-175);
INSERT INTO t1(a,c) VALUES (1.225e+0, 1.225e+0);
INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
-Warnings:
-Warning 1265 Data truncated for column 'c' at row 1
INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
Warnings:
Warning 1265 Data truncated for column 'c' at row 1
INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
-Warnings:
-Warning 1265 Data truncated for column 'c' at row 1
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
-Warnings:
-Warning 1265 Data truncated for column 'c' at row 1
SELECT * FROM t1;
a b c
9.999999 10 10
-1.225e-05 1.2e-05 1e-0
-0.0001225 0.00012 NULL
+0.00001225 1.22e-5 1e-5
+0.0001225 1.22e-4 NULL
0.1225 0.1225 NULL
0.1225877 0.12259 NULL
12.25 12.25 NULL
12.25 12.25 12.2
122500 122500 NULL
-12250000000 1.2e+10 NULL
-1.225e+15 1.2e+15 NULL
+12250000000 1.22e10 NULL
+1.225e15 1.22e15 NULL
5000000 5000000 NULL
-1.25e+78 1.2e+78 NULL
+1.25e78 1.25e78 NULL
1.25e-94 1.2e-94 NULL
-1.25e+203 1e+203 NULL
+1.25e203 1.2e203 NULL
1.25e-175 1e-175 NULL
1.225 NULL 1.23
1.37 NULL 1.37
--1.37 NULL -1.3
-0.00187 NULL 0.00
--0.0187 NULL -0.0
+-1.37 NULL -1.4
+0.00187 NULL 2e-3
+-0.0187 NULL 0
5000 NULL 5000
--5000 NULL -500
+-5000 NULL -5e3
DROP TABLE t1;
CREATE TABLE t1 (
a char(20) NOT NULL,
@@ -586,32 +580,30 @@ INSERT INTO t1(a,c) VALUES (1.37e+0, 1.37e+0);
INSERT INTO t1(a,c) VALUES (-1.37e+0, -1.37e+0);
INSERT INTO t1(a,c) VALUES (1.87e-3, 1.87e-3);
INSERT INTO t1(a,c) VALUES (-1.87e-2, -1.87e-2);
-Warnings:
-Warning 1265 Data truncated for column 'c' at row 1
INSERT INTO t1(a,c) VALUES (5000e+0, 5000e+0);
INSERT INTO t1(a,c) VALUES (-5000e+0, -5000e+0);
SELECT * FROM t1;
a b c
9.999999 10 9.999
-1.225e-05 1.2e-05 1e-05
-0.0001225 0.00012 NULL
+0.00001225 1.22e-5 1e-5
+0.0001225 1.22e-4 NULL
0.1225 0.1225 NULL
0.1225877 0.12259 NULL
12.25 12.25 NULL
12.25 12.25 12.25
122500 122500 NULL
-12250000000 1.2e+10 NULL
-1.225e+15 1.2e+15 NULL
+12250000000 1.22e10 NULL
+1.225e15 1.22e15 NULL
5000000 5000000 NULL
-1.25e+78 1.2e+78 NULL
+1.25e78 1.25e78 NULL
1.25e-94 1.2e-94 NULL
-1.25e+203 1e+203 NULL
+1.25e203 1.2e203 NULL
1.25e-175 1e-175 NULL
1.225 NULL 1.225
1.37 NULL 1.37
-1.37 NULL -1.37
0.00187 NULL 0.002
--0.0187 NULL -0.01
+-0.0187 NULL -0.02
5000 NULL 5000
-5000 NULL -5000
DROP TABLE t1;
@@ -639,3 +631,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/insert_notembedded.result b/mysql-test/r/insert_notembedded.result
index ac69cb65972..2315d695abe 100644
--- a/mysql-test/r/insert_notembedded.result
+++ b/mysql-test/r/insert_notembedded.result
@@ -122,5 +122,6 @@ a b
connection: default
select * from t1;
a b
+unlock tables;
drop table t1;
set low_priority_updates=default;
diff --git a/mysql-test/r/ipv4_as_ipv6.result b/mysql-test/r/ipv4_as_ipv6.result
new file mode 100644
index 00000000000..8523dc82f02
--- /dev/null
+++ b/mysql-test/r/ipv4_as_ipv6.result
@@ -0,0 +1,179 @@
+=============Test of '127.0.0.1' (IPv4) ===========================
+mysqld is alive
+CREATE USER testuser@'127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'127.0.0.1';
+SHOW GRANTS FOR testuser@'127.0.0.1';
+Grants for testuser@127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
+SET @nip= inet_aton('127.0.0.1');
+SELECT @nip;
+@nip
+2130706433
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+127.0.0.1
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
+RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
+SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'127.0.0.1';
+=============Test of '0:0:0:0:0:FFFF:127.0.0.1' ===================
+mysqld is alive
+CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1';
+Grants for testuser@0:0:0:0:0:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1'
+SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:FFFF:127.0.0.1';
+RENAME USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' to testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0:0:0:0:0:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
+=============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ====
+mysqld is alive
+CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+Grants for testuser@0000:0000:0000:0000:0000:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'
+SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+RENAME USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' to testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+=============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ====
+mysqld is alive
+CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+Grants for testuser@0:0000:0000:0:0000:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1'
+SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+RENAME USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' to testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+=============Test of '0::0000:FFFF:127.0.0.1' ====
+mysqld is alive
+CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1';
+Grants for testuser@0::0000:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:FFFF:127.0.0.1'
+SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0::0000:FFFF:127.0.0.1';
+RENAME USER testuser@'0::0000:FFFF:127.0.0.1' to testuser1@'0::0000:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0::0000:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0::0000:FFFF:127.0.0.1';
+=============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================
+=============Test of '::FFFF:127.0.0.1' ===========================
+mysqld is alive
+CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1';
+Grants for testuser@::FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'::FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::FFFF:127.0.0.1'
+SET @nip= inet_aton('::FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'::FFFF:127.0.0.1';
+RENAME USER testuser@'::FFFF:127.0.0.1' to testuser1@'::FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'::FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'::FFFF:127.0.0.1';
+=============Test of '::FFFF:127.0.0.1/96' ========================
+=============Test of '::1' ========================
+connect (con1, ::1, root, , test, MASTER_MYPORT,);
+Got one of the listed errors
diff --git a/mysql-test/r/ipv4_as_ipv6_win.result b/mysql-test/r/ipv4_as_ipv6_win.result
new file mode 100644
index 00000000000..45e23d4d7e6
--- /dev/null
+++ b/mysql-test/r/ipv4_as_ipv6_win.result
@@ -0,0 +1,32 @@
+=============Test of '127.0.0.1' (IPv4) ===========================
+mysqld is alive
+CREATE USER testuser@'127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'127.0.0.1';
+SHOW GRANTS FOR testuser@'127.0.0.1';
+Grants for testuser@127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
+SET @nip= inet_aton('127.0.0.1');
+SELECT @nip;
+@nip
+2130706433
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+127.0.0.1
+SELECT USER();
+USER()
+root@127.0.0.1
+SELECT current_user();
+current_user()
+root@127.0.0.1
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
+RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
+SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@127.0.0.1
+DROP USER testuser1@'127.0.0.1';
+=============Test of '::1' ========================
+connect (con1, ::1, root, , test, MASTER_MYPORT);
+Got one of the listed errors
diff --git a/mysql-test/r/ipv6.result b/mysql-test/r/ipv6.result
new file mode 100644
index 00000000000..566938296a9
--- /dev/null
+++ b/mysql-test/r/ipv6.result
@@ -0,0 +1,264 @@
+=============Test of '::1' ========================================
+mysqld is alive
+CREATE USER testuser@'::1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'::1';
+SHOW GRANTS FOR testuser@'::1';
+Grants for testuser@::1
+GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
+SET @nip= inet_aton('::1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'::1';
+RENAME USER testuser@'::1' to testuser1@'::1';
+SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'::1';
+=============Test of '::1/128' ====================================
+=============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====
+mysqld is alive
+CREATE USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
+SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
+Grants for testuser@0000:0000:0000:0000:0000:0000:0000:0001
+GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001'
+SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
+RENAME USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' to testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
+SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:0000:0000:0001' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
+=============Test of '0:0:0:0:0:0:0:1' ============================
+mysqld is alive
+CREATE USER testuser@'0:0:0:0:0:0:0:1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0:0:0:0:0:0:0:1';
+SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:1';
+Grants for testuser@0:0:0:0:0:0:0:1
+GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:0:0:1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:0:0:1'
+SET @nip= inet_aton('0:0:0:0:0:0:0:1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:0:0:1';
+RENAME USER testuser@'0:0:0:0:0:0:0:1' to testuser1@'0:0:0:0:0:0:0:1';
+SET PASSWORD FOR testuser1@'0:0:0:0:0:0:0:1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0:0:0:0:0:0:0:1';
+=============Test of '127.0.0.1' (IPv4) ===========================
+mysqld is alive
+CREATE USER testuser@'127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'127.0.0.1';
+SHOW GRANTS FOR testuser@'127.0.0.1';
+Grants for testuser@127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'127.0.0.1'
+SET @nip= inet_aton('127.0.0.1');
+SELECT @nip;
+@nip
+2130706433
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+127.0.0.1
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
+RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
+SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'127.0.0.1';
+=============Test of '0:0:0:0:0:FFFF:127.0.0.1' ===================
+mysqld is alive
+CREATE USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0:0:0:0:0:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0:0:0:0:0:FFFF:127.0.0.1';
+Grants for testuser@0:0:0:0:0:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:FFFF:127.0.0.1'
+SET @nip= inet_aton('0:0:0:0:0:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:FFFF:127.0.0.1';
+RENAME USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' to testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0:0:0:0:0:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
+=============Test of '0000:0000:0000:0000:0000:FFFF:127.0.0.1' ====
+mysqld is alive
+CREATE USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+Grants for testuser@0000:0000:0000:0000:0000:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:FFFF:127.0.0.1'
+SET @nip= inet_aton('0000:0000:0000:0000:0000:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+RENAME USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' to testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
+=============Test of '0:0000:0000:0:0000:FFFF:127.0.0.1' ====
+mysqld is alive
+CREATE USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+Grants for testuser@0:0000:0000:0:0000:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0000:0000:0:0000:FFFF:127.0.0.1'
+SET @nip= inet_aton('0:0000:0000:0:0000:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+RENAME USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' to testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
+=============Test of '0::0000:FFFF:127.0.0.1' ====
+mysqld is alive
+CREATE USER testuser@'0::0000:FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0::0000:FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'0::0000:FFFF:127.0.0.1';
+Grants for testuser@0::0000:FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'0::0000:FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0::0000:FFFF:127.0.0.1'
+SET @nip= inet_aton('0::0000:FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0::0000:FFFF:127.0.0.1';
+RENAME USER testuser@'0::0000:FFFF:127.0.0.1' to testuser1@'0::0000:FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'0::0000:FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'0::0000:FFFF:127.0.0.1';
+=============Test of '0:0:0:0:0:FFFF:127.0.0.1/96' ================
+=============Test of '::FFFF:127.0.0.1' ===========================
+mysqld is alive
+CREATE USER testuser@'::FFFF:127.0.0.1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'::FFFF:127.0.0.1';
+SHOW GRANTS FOR testuser@'::FFFF:127.0.0.1';
+Grants for testuser@::FFFF:127.0.0.1
+GRANT USAGE ON *.* TO 'testuser'@'::FFFF:127.0.0.1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::FFFF:127.0.0.1'
+SET @nip= inet_aton('::FFFF:127.0.0.1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@localhost
+SELECT current_user();
+current_user()
+root@localhost
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'::FFFF:127.0.0.1';
+RENAME USER testuser@'::FFFF:127.0.0.1' to testuser1@'::FFFF:127.0.0.1';
+SET PASSWORD FOR testuser1@'::FFFF:127.0.0.1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@localhost
+DROP USER testuser1@'::FFFF:127.0.0.1';
+=============Test of '::FFFF:127.0.0.1/96' ========================
diff --git a/mysql-test/r/ipv6_win.result b/mysql-test/r/ipv6_win.result
new file mode 100644
index 00000000000..8082e8aa25e
--- /dev/null
+++ b/mysql-test/r/ipv6_win.result
@@ -0,0 +1,88 @@
+=============Test of '::1' ========================================
+mysqld is alive
+CREATE USER testuser@'::1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'::1';
+SHOW GRANTS FOR testuser@'::1';
+Grants for testuser@::1
+GRANT USAGE ON *.* TO 'testuser'@'::1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'::1'
+SET @nip= inet_aton('::1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@::1
+SELECT current_user();
+current_user()
+root@::1
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'::1';
+RENAME USER testuser@'::1' to testuser1@'::1';
+SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@::1
+DROP USER testuser1@'::1';
+=============Test of '::1/128' ====================================
+=============Test of '0000:0000:0000:0000:0000:0000:0000:0001' ====
+mysqld is alive
+CREATE USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
+SHOW GRANTS FOR testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
+Grants for testuser@0000:0000:0000:0000:0000:0000:0000:0001
+GRANT USAGE ON *.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0000:0000:0000:0000:0000:0000:0000:0001'
+SET @nip= inet_aton('0000:0000:0000:0000:0000:0000:0000:0001');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@::1
+SELECT current_user();
+current_user()
+root@::1
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
+RENAME USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' to testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
+SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:0000:0000:0001' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@::1
+DROP USER testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
+=============Test of '0:0:0:0:0:0:0:1' ============================
+mysqld is alive
+CREATE USER testuser@'0:0:0:0:0:0:0:1' identified by '1234';
+GRANT ALL ON test.* TO testuser@'0:0:0:0:0:0:0:1';
+SHOW GRANTS FOR testuser@'0:0:0:0:0:0:0:1';
+Grants for testuser@0:0:0:0:0:0:0:1
+GRANT USAGE ON *.* TO 'testuser'@'0:0:0:0:0:0:0:1' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF'
+GRANT ALL PRIVILEGES ON `test`.* TO 'testuser'@'0:0:0:0:0:0:0:1'
+SET @nip= inet_aton('0:0:0:0:0:0:0:1');
+SELECT @nip;
+@nip
+NULL
+SELECT inet_ntoa(@nip);
+inet_ntoa(@nip)
+NULL
+SELECT USER();
+USER()
+root@::1
+SELECT current_user();
+current_user()
+root@::1
+SHOW PROCESSLIST;
+REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:0:0:1';
+RENAME USER testuser@'0:0:0:0:0:0:0:1' to testuser1@'0:0:0:0:0:0:0:1';
+SET PASSWORD FOR testuser1@'0:0:0:0:0:0:0:1' = PASSWORD ('9876');
+SELECT USER();
+USER()
+root@::1
+DROP USER testuser1@'0:0:0:0:0:0:0:1';
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 083be3737f7..dbe8b48d503 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/key_cache.result b/mysql-test/r/key_cache.result
index 08d8059f61b..844109dba1f 100644
--- a/mysql-test/r/key_cache.result
+++ b/mysql-test/r/key_cache.result
@@ -274,8 +274,26 @@ Key_blocks_used 4
show status like 'key_blocks_unused';
Variable_name Value
Key_blocks_unused KEY_BLOCKS_UNUSED
+create table t1 (a int primary key);
+cache index t1 in keycache2;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+insert t1 values (1),(2),(3),(4),(5),(6),(7),(8);
set global keycache2.key_buffer_size=0;
+select * from t1;
+a
+1
+2
+3
+4
+5
+6
+7
+8
+drop table t1;
set global keycache3.key_buffer_size=100;
+Warnings:
+Warning 1292 Truncated incorrect key_buffer_size value: '100'
set global keycache3.key_buffer_size=0;
create table t1 (mytext text, FULLTEXT (mytext));
insert t1 values ('aaabbb');
@@ -334,8 +352,7 @@ test.t1 check status OK
DROP TABLE t1,t2;
set global key_cache_block_size= @my_key_cache_block_size;
set @@global.key_buffer_size=0;
-Warnings:
-Warning 1438 Cannot drop default keycache
+ERROR HY000: Cannot drop default keycache
select @@global.key_buffer_size;
@@global.key_buffer_size
2097152
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 1e488b320d7..5e25132880f 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -251,15 +251,15 @@ CREATE TABLE t1 (c1 INT, c2 TIMESTAMP, c3 REAL, c4 DOUBLE);
INSERT INTO t1 (c1, c2, c3, c4) VALUES (10, '1970-02-01 01:02:03', 1.1E-100, 1.1E+100);
SELECT * FROM t1;
c1 c2 c3 c4
-10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+10 1970-02-01 01:02:03 1.1e-100 1.1e100
SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1' FIELDS ENCLOSED BY '-' FROM t1;
--10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e+100-
+-10- -1970\-02\-01 01:02:03- -1.1e\-100- -1.1e100-
EOF
TRUNCATE t1;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1' INTO TABLE t1 FIELDS ENCLOSED BY '-';
SELECT * FROM t1;
c1 c2 c3 c4
-10 1970-02-01 01:02:03 1.1e-100 1.1e+100
+10 1970-02-01 01:02:03 1.1e-100 1.1e100
DROP TABLE t1;
# --
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.result b/mysql-test/r/lock.result
index 7ec07fb5273..1f8f6aa04ae 100644
--- a/mysql-test/r/lock.result
+++ b/mysql-test/r/lock.result
@@ -48,6 +48,9 @@ unlock tables;
lock tables t1 write, t1 as t1_alias read;
insert into t1 select index1,nr from t1 as t1_alias;
drop table t1,t2;
+ERROR HY000: Table 't2' was not locked with LOCK TABLES
+unlock tables;
+drop table t1,t2;
create table t1 (c1 int);
create table t2 (c1 int);
create table t3 (c1 int);
@@ -69,6 +72,9 @@ ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
delete t2 from t1,t2 where t1.a=t2.a;
ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
drop table t1,t2;
+ERROR HY000: Table 't2' was locked with a READ lock and can't be updated
+unlock tables;
+drop table t2,t1;
End of 4.1 tests.
drop table if exists t1;
create table t1 (a int);
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index d8768e802ea..3f1165fd069 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -27,6 +27,7 @@ update t1,t2 set c=a where b=d;
select c from t2;
c
2
+unlock tables;
drop table t1;
drop table t2;
create table t1 (a int);
@@ -209,3 +210,12 @@ select @tlwa < @tlwb;
@tlwa < @tlwb
1
End of 5.1 tests
+drop table if exists t1;
+create table t1 (i int);
+connection: default
+lock tables t1 write;
+connection: flush
+flush tables with read lock;;
+connection: default
+flush tables;
+drop table t1;
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/log_tables.result b/mysql-test/r/log_tables.result
index f8321520880..1666d5e0297 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -247,13 +247,10 @@ set global general_log='OFF';
set global slow_query_log='OFF';
set @save_storage_engine= @@session.storage_engine;
set storage_engine= MEMORY;
-alter table mysql.slow_log engine=ndb;
-ERROR HY000: This storage engine cannot be used for log tables"
-alter table mysql.slow_log engine=innodb;
-ERROR HY000: This storage engine cannot be used for log tables"
-alter table mysql.slow_log engine=archive;
-ERROR HY000: This storage engine cannot be used for log tables"
-alter table mysql.slow_log engine=blackhole;
+alter table mysql.slow_log engine=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown storage engine 'NonExistentEngine'
+alter table mysql.slow_log engine=memory;
ERROR HY000: This storage engine cannot be used for log tables"
set storage_engine= @save_storage_engine;
drop table mysql.slow_log;
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..2513e94137f 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 344
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 359
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/myisam.result b/mysql-test/r/myisam.result
index c68bc91aa41..fb053f32d43 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -529,6 +529,7 @@ select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
a a b
1 1 1
2 2 1
+unlock tables;
drop table t1,t2;
CREATE TABLE t1 (c1 varchar(250) NOT NULL);
CREATE TABLE t2 (c1 varchar(250) NOT NULL, PRIMARY KEY (c1));
@@ -542,6 +543,7 @@ INSERT INTO t2 VALUES ('test000001'), ('test000005');
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
t1c1 t2c1
+UNLOCK TABLES;
DROP TABLE t1,t2;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
Got one of the listed errors
diff --git a/mysql-test/r/myisam_crash_before_flush_keys.result b/mysql-test/r/myisam_crash_before_flush_keys.result
index d3545ea47d0..43eb1625409 100644
--- a/mysql-test/r/myisam_crash_before_flush_keys.result
+++ b/mysql-test/r/myisam_crash_before_flush_keys.result
@@ -3,6 +3,8 @@
#
# Don't test this under valgrind, memory leaks will occur
# Binary must be compiled with debug for crash to occur
+call mtr.add_suppression("Got an error from thread_id=.*ha_myisam.cc:");
+call mtr.add_suppression("MySQL thread id .*, query id .* localhost.*root Checking table");
SET GLOBAL delay_key_write=ALL;
CREATE TABLE t1(a INT,
b INT,
diff --git a/mysql-test/r/myisampack.result b/mysql-test/r/myisampack.result
index fbcd8aed17a..dd14c31f32e 100644
--- a/mysql-test/r/myisampack.result
+++ b/mysql-test/r/myisampack.result
@@ -1,3 +1,4 @@
+DROP TABLE IF EXISTS t1,t2,t3;
CREATE TABLE t1(c1 DOUBLE, c2 DOUBLE, c3 DOUBLE, c4 DOUBLE, c5 DOUBLE,
c6 DOUBLE, c7 DOUBLE, c8 DOUBLE, c9 DOUBLE, a INT PRIMARY KEY);
INSERT INTO t1 VALUES
@@ -85,5 +86,37 @@ FLUSH TABLE mysql_db1.t1;
SELECT COUNT(*) FROM mysql_db1.t1 WHERE c2 < 5;
COUNT(*)
128
+# ===== myisampack.1 =====
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES(20);
+CREATE TABLE t2(a INT);
+INSERT INTO t2 VALUES(40);
+FLUSH TABLE t1,t2;
+#If the myisampack --join operation is successful, we have table t3(.frm)
+#so we should be able to query about the table from server.
+SELECT COUNT(a) FROM t3;
+COUNT(a)
+1024
+# ===== myisampack.2 =====
+FLUSH TABLE t3;
+#Tests the myisampack join operation with an existing destination .frm file,
+#the command should return correct exit status(0) and
+#we should be able to query the table.
+SELECT COUNT(a) FROM t3;
+COUNT(a)
+1024
+# ===== myisampack.3 =====
+DROP TABLE t3;
+#Tests the myisampack join operation without frm file for the first and second table
+#No frm file is generated in this and we shouldn't be able to access the newly
+#created table
+SELECT COUNT(a) FROM t3;
+ERROR 42S02: Table 'test.t3' doesn't exist
+# ===== myisampack.4 =====
+#Tests the myisampack join operation with an existing destination .frm,.MYI,.MDI
+#the command should fail with exit status 2
+myisampack: Can't create/write to file (Errcode: 17)
+Aborted: file is not compressed
+DROP TABLE t1,t2,t3;
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
diff --git a/mysql-test/r/mysql.result b/mysql-test/r/mysql.result
index 68f30ed80f8..3c53faff526 100644
--- a/mysql-test/r/mysql.result
+++ b/mysql-test/r/mysql.result
@@ -201,12 +201,210 @@ COUNT (*)
ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (errno)
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
-Warning (Code 1286): Unknown table engine 'nonexistent'
+*************************** 1. row ***************************
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
+1: 1
+2: 2
+3: 3
+4: 4
+5: 5
+6: 6
+7: 7
+8: 8
+9: 9
+0: 0
++---+
+| 1 |
++---+
+| 1 |
++---+
+Warning (Code 1286): Unknown storage engine 'nonexistent'
Warning (Code 1266): Using storage engine MyISAM for table 't2'
-Warning (Code 1286): Unknown table engine 'nonexistent2'
+Warning (Code 1286): Unknown storage 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 821ad31871f..394beb042a5 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -169,3 +169,4 @@ DROP PROCEDURE testproc;
WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary.
WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary.
WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.
+The --upgrade-system-tables option was used, databases won't be touched.
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index 9d4fde96d18..097e51a78de 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -21,7 +21,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -37,24 +37,60 @@ SET TIMESTAMP=1000000000/*!*/;
create table t2 (id int auto_increment not null primary key)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t2 values ()
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -64,18 +100,33 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -86,7 +137,51 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -96,18 +191,24 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -121,7 +222,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -137,24 +238,60 @@ SET TIMESTAMP=1000000000/*!*/;
create table t2 (id int auto_increment not null primary key)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("abirvalg")
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1000000000/*!*/;
insert into t2 values ()
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -164,18 +301,33 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`word`)
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -186,7 +338,51 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -196,18 +392,24 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
insert into t1 values ("Alas")
/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -299,7 +501,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -349,7 +551,7 @@ DELIMITER /*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -359,31 +561,73 @@ SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a varchar(64) character set utf8)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=7/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO TABLE `t1` CHARACTER SET koi8r FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`)
/*!*/;
SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1000000000/*!*/;
drop table t1
/*!*/;
DELIMITER ;
@@ -399,9 +643,9 @@ We expect this value to be 1
The bug being tested was that 'Query' lines were not preceded by '#'
If the line is in the table, it had to have been preceded by a '#'
-SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%';
-BUG#28293_expect_1
-1
+SELECT COUNT(*) AS `BUG#28293_expect_3` FROM patch WHERE a LIKE '%Query%';
+BUG#28293_expect_3
+3
DROP TABLE patch;
FLUSH LOGS;
CREATE TABLE t1(a INT);
@@ -426,7 +670,7 @@ CREATE TABLE t1 (a INT, b CHAR(64));
flush logs;
INSERT INTO t1 VALUES (1,USER());
flush logs;
-mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql
+mysqlbinlog var/log/master-bin.000018 > var/tmp/bug31611.sql
mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql
INSERT INTO t1 VALUES (1,USER());
ERROR 42000: INSERT command denied to user 'untrusted'@'localhost' for table 't1'
@@ -452,7 +696,7 @@ an_int 1000
a_decimal 907.79
a_string Just a test
DROP TABLE t1;
->> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql
+>> mysqlbinlog var/log/master-bin.000020 > var/tmp/bug32580.sql
>> mysql test < var/tmp/bug32580.sql
SELECT * FROM t1;
a_real 158.883
diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result
index dba9bdc9d70..52a589ca7c1 100644
--- a/mysql-test/r/mysqlbinlog2.result
+++ b/mysql-test/r/mysqlbinlog2.result
@@ -22,7 +22,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -31,26 +31,56 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -61,35 +91,65 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=1/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=1/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -100,23 +160,45 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=4/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1579609946/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=4/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -130,7 +212,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -139,17 +221,25 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
-SET INSERT_ID=3/*!*/;
-SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
/*!*/;
DELIMITER ;
# End of log file
@@ -161,18 +251,21 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=4/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1579609946/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-insert into t1 values(null, "d")
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+insert into t1 values(null, "c")
/*!*/;
DELIMITER ;
# End of log file
@@ -184,27 +277,45 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=3/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -218,7 +329,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -227,14 +338,26 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -249,7 +372,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -258,41 +381,77 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -303,50 +462,86 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=1/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=1/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -357,38 +552,66 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=4/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1579609946/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=4/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -402,7 +625,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -411,28 +634,69 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=6/*!*/;
DELIMITER ;
# End of log file
@@ -444,42 +708,66 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=3/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -493,7 +781,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -502,14 +790,26 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -523,7 +823,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -532,26 +832,56 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -562,35 +892,65 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=1/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=1/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -600,23 +960,45 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-SET INSERT_ID=4/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1579609946/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=4/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -630,7 +1012,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -639,17 +1021,25 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
-SET INSERT_ID=3/*!*/;
-SET TIMESTAMP=1579609944/*!*/;
-insert into t1 values(null, "c")
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
/*!*/;
DELIMITER ;
# End of log file
@@ -660,18 +1050,21 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-SET INSERT_ID=4/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1579609946/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
-insert into t1 values(null, "d")
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+insert into t1 values(null, "c")
/*!*/;
DELIMITER ;
# End of log file
@@ -683,27 +1076,45 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=3/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -717,7 +1128,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -726,14 +1137,26 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -747,7 +1170,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -756,41 +1179,77 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -801,50 +1260,86 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=1/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=1/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -854,38 +1349,66 @@ ROLLBACK /* added by mysqlbinlog */;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-SET INSERT_ID=4/*!*/;
-use test/*!*/;
-SET TIMESTAMP=1579609946/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+insert into t1 values(null, "c")
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=4/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -899,7 +1422,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -908,29 +1431,69 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+SET @@session.pseudo_thread_id=999999999/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.sql_mode=0/*!*/;
+SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
+/*!\C latin1 *//*!*/;
+SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
+SET @@session.lc_time_names=0/*!*/;
+SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -941,42 +1504,66 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET INSERT_ID=3/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609944/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=3/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
DELIMITER /*!*/;
-SET INSERT_ID=6/*!*/;
-use test/*!*/;
SET TIMESTAMP=1579609943/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET INSERT_ID=6/*!*/;
+use test/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -990,7 +1577,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -999,14 +1586,26 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -1020,7 +1619,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1579609942/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -1029,30 +1628,66 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int auto_increment not null primary key, b char(3))
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=1/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "a")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=2/*!*/;
SET TIMESTAMP=1579609942/*!*/;
insert into t1 values(null, "b")
/*!*/;
+SET TIMESTAMP=1579609942/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=3/*!*/;
SET TIMESTAMP=1579609944/*!*/;
insert into t1 values(null, "c")
/*!*/;
+SET TIMESTAMP=1579609944/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=4/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "d")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=5/*!*/;
SET TIMESTAMP=1579609946/*!*/;
insert into t1 values(null, "e")
/*!*/;
+SET TIMESTAMP=1579609946/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+BEGIN
+/*!*/;
SET INSERT_ID=6/*!*/;
SET TIMESTAMP=1579609943/*!*/;
insert into t1 values(null, "f")
/*!*/;
+SET TIMESTAMP=1579609943/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
diff --git a/mysql-test/r/mysqlbinlog_row.result b/mysql-test/r/mysqlbinlog_row.result
index 9b562ac0fff..85416138c6d 100644
--- a/mysql-test/r/mysqlbinlog_row.result
+++ b/mysql-test/r/mysqlbinlog_row.result
@@ -339,7 +339,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/r/mysqlbinlog_row_innodb.result
index 86f0b67ebb3..dd98a12a0de 100644
--- a/mysql-test/r/mysqlbinlog_row_innodb.result
+++ b/mysql-test/r/mysqlbinlog_row_innodb.result
@@ -495,10 +495,10 @@ c15 0000000000
c16 -9223372036854775808
c17 0
c18 00000000000000000000
-c19 -3.40282e+38
+c19 -3.40282e38
c20 1.17549e-38
c21 000000000000
-c22 -1.7976931348623e+308
+c22 -1.7976931348623e308
c23 2.2250738585072e-308
c24 0000000000000000000000
c25 -9999999999
@@ -574,12 +574,12 @@ c15 4294967295
c16 9223372036854775807
c17 18446744073709551615
c18 18446744073709551615
-c19 3.40282e+38
-c20 3.40282e+38
-c21 03.40282e+38
-c22 1.7976931348623e+308
-c23 1.7976931348623e+308
-c24 001.7976931348623e+308
+c19 3.40282e38
+c20 3.40282e38
+c21 003.40282e38
+c22 1.7976931348623e308
+c23 1.7976931348623e308
+c24 0001.7976931348623e308
c25 9999999999
c26 9999999999
c27 9999999999
@@ -1557,12 +1557,12 @@ c15 4294967295
c16 9223372036854775807
c17 18446744073709551615
c18 18446744073709551615
-c19 3.40282e+38
-c20 3.40282e+38
-c21 03.40282e+38
-c22 1.7976931348623e+308
-c23 1.7976931348623e+308
-c24 001.7976931348623e+308
+c19 3.40282e38
+c20 3.40282e38
+c21 003.40282e38
+c22 1.7976931348623e308
+c23 1.7976931348623e308
+c24 0001.7976931348623e308
c25 9999999999
c26 9999999999
c27 9999999999
@@ -1636,10 +1636,10 @@ c15 0000000000
c16 -9223372036854775808
c17 0
c18 00000000000000000000
-c19 -3.40282e+38
+c19 -3.40282e38
c20 1.17549e-38
c21 000000000000
-c22 -1.7976931348623e+308
+c22 -1.7976931348623e308
c23 2.2250738585072e-308
c24 0000000000000000000000
c25 -9999999999
@@ -2256,7 +2256,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -2365,7 +2365,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1
### SET
-### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2458,7 +2458,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1
### SET
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2553,7 +2553,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1
### SET
-### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
+### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
@@ -2580,7 +2580,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -2634,7 +2634,7 @@ BEGIN
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test.t1
### SET
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2727,7 +2727,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
-### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2807,7 +2807,7 @@ BEGIN
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
### SET
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2900,7 +2900,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -2980,7 +2980,7 @@ BEGIN
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
### SET
-### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3073,7 +3073,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
-### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
+### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
@@ -3100,7 +3100,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -3153,7 +3153,7 @@ BEGIN
### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
### SET
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3246,7 +3246,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1
### WHERE
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3326,7 +3326,7 @@ BEGIN
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
### SET
-### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
+### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
@@ -3353,7 +3353,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -3419,7 +3419,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3512,7 +3512,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
-### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3605,7 +3605,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
-### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */
+### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */
### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */
@@ -3698,7 +3698,7 @@ BEGIN
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1
### WHERE
-### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */
+### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */
### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */
### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */
### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */
@@ -3725,7 +3725,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -3879,7 +3879,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4246,7 +4246,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4807,7 +4807,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/r/mysqlbinlog_row_myisam.result
index b9366d941f8..87f9ab877e1 100644
--- a/mysql-test/r/mysqlbinlog_row_myisam.result
+++ b/mysql-test/r/mysqlbinlog_row_myisam.result
@@ -495,10 +495,10 @@ c15 0000000000
c16 -9223372036854775808
c17 0
c18 00000000000000000000
-c19 -3.40282e+38
+c19 -3.40282e38
c20 1.17549e-38
c21 000000000000
-c22 -1.7976931348623e+308
+c22 -1.7976931348623e308
c23 2.2250738585072e-308
c24 0000000000000000000000
c25 -9999999999
@@ -574,12 +574,12 @@ c15 4294967295
c16 9223372036854775807
c17 18446744073709551615
c18 18446744073709551615
-c19 3.40282e+38
-c20 3.40282e+38
-c21 03.40282e+38
-c22 1.7976931348623e+308
-c23 1.7976931348623e+308
-c24 001.7976931348623e+308
+c19 3.40282e38
+c20 3.40282e38
+c21 003.40282e38
+c22 1.7976931348623e308
+c23 1.7976931348623e308
+c24 0001.7976931348623e308
c25 9999999999
c26 9999999999
c27 9999999999
@@ -1557,12 +1557,12 @@ c15 4294967295
c16 9223372036854775807
c17 18446744073709551615
c18 18446744073709551615
-c19 3.40282e+38
-c20 3.40282e+38
-c21 03.40282e+38
-c22 1.7976931348623e+308
-c23 1.7976931348623e+308
-c24 001.7976931348623e+308
+c19 3.40282e38
+c20 3.40282e38
+c21 003.40282e38
+c22 1.7976931348623e308
+c23 1.7976931348623e308
+c24 0001.7976931348623e308
c25 9999999999
c26 9999999999
c27 9999999999
@@ -1636,10 +1636,10 @@ c15 0000000000
c16 -9223372036854775808
c17 0
c18 00000000000000000000
-c19 -3.40282e+38
+c19 -3.40282e38
c20 1.17549e-38
c21 000000000000
-c22 -1.7976931348623e+308
+c22 -1.7976931348623e308
c23 2.2250738585072e-308
c24 0000000000000000000000
c25 -9999999999
@@ -2256,7 +2256,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -2584,7 +2584,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -3110,7 +3110,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -3365,7 +3365,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -3745,7 +3745,7 @@ BEGIN
### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */
-### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */
+### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */
### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */
### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */
### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */
@@ -3901,7 +3901,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4274,7 +4274,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
@@ -4845,7 +4845,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
diff --git a/mysql-test/r/mysqlbinlog_row_trans.result b/mysql-test/r/mysqlbinlog_row_trans.result
index 9c3348a9e76..5c96db7d19b 100644
--- a/mysql-test/r/mysqlbinlog_row_trans.result
+++ b/mysql-test/r/mysqlbinlog_row_trans.result
@@ -135,7 +135,7 @@ ROLLBACK/*!*/;
use test/*!*/;
SET TIMESTAMP=1000000000/*!*/;
SET @@session.pseudo_thread_id=#/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
@@ -215,85 +215,20 @@ COMMIT/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-BEGIN
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-BEGIN
-/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
BEGIN
/*!*/;
# at #
# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
-### INSERT INTO test.t1
-### SET
-### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t1
-### SET
-### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### INSERT INTO test.t1
-### SET
-### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-# at #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
-### UPDATE test.t1
-### WHERE
-### @1=1 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### SET
-### @1=11 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t1
-### WHERE
-### @1=2 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### SET
-### @1=12 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### UPDATE test.t1
-### WHERE
-### @1=3 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-### SET
-### @1=13 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-# at #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t1
-### WHERE
-### @1=12 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-# at #
-# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t2
@@ -309,6 +244,16 @@ BEGIN
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
@@ -334,33 +279,27 @@ BEGIN
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
-#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
-### DELETE FROM test.t2
-### WHERE
-### @1=12 /* INT meta=0 nullable=1 is_null=0 */
-### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-BEGIN
+COMMIT
/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-TRUNCATE TABLE t1
+BEGIN
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
+#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
+### DELETE FROM test.t2
+### WHERE
+### @1=12 /* INT meta=0 nullable=1 is_null=0 */
+### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-TRUNCATE TABLE t2
+COMMIT
/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -417,6 +356,24 @@ BEGIN
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
+#010909 4:46:40 server id 1 end_log_pos # Xid = #
+COMMIT/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+TRUNCATE TABLE t1
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+TRUNCATE TABLE t2
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
@@ -433,6 +390,16 @@ BEGIN
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
@@ -458,6 +425,16 @@ BEGIN
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+COMMIT
+/*!*/;
+# at #
+#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
+SET TIMESTAMP=1000000000/*!*/;
+BEGIN
+/*!*/;
+# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
@@ -468,12 +445,7 @@ BEGIN
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
-ROLLBACK
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-BEGIN
+COMMIT
/*!*/;
# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
@@ -481,9 +453,6 @@ SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t1
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # Xid = #
-COMMIT/*!*/;
-# at #
#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
TRUNCATE TABLE t2
diff --git a/mysql-test/r/mysqlcheck.result b/mysql-test/r/mysqlcheck.result
index 5f1a0565b10..06175955d7f 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -162,18 +162,15 @@ 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
-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
+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
mysqlcheck --fix-db-names --fix-table-names --all-databases
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/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result
new file mode 100644
index 00000000000..bd26012873d
--- /dev/null
+++ b/mysql-test/r/mysqld--help-notwin.result
@@ -0,0 +1,992 @@
+The following options may be given as the first argument:
+--print-defaults Print the program argument list and exit
+--no-defaults Don't read default options from any options file
+--defaults-file=# Only read default options from the given file #
+--defaults-extra-file=# Read this file after the global files are read
+
+ --abort-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --allow-suspicious-udfs
+ Allows use of UDFs consisting of only one symbol xxx()
+ without corresponding xxx_init() or xxx_deinit(). That
+ also means that one can load any function from any
+ library, for example exit() from libc.so
+ -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode
+ will also set transaction isolation level 'serializable'.
+ --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON,
+ OFF, FORCE (don't start if the plugin fails to load).
+ --auto-increment-increment[=#]
+ Auto-increment columns are incremented by this
+ --auto-increment-offset[=#]
+ Offset added to Auto-increment columns. Used when
+ auto-increment-increment != 1
+ --automatic-sp-privileges
+ Creating and dropping stored procedures alters ACLs
+ (Defaults to on; use --skip-automatic-sp-privileges to disable.)
+ --back-log=# The number of outstanding connection requests MySQL can
+ have. This comes into play when the main MySQL thread
+ gets very many connection requests in a very short time
+ -b, --basedir=name Path to installation directory. All paths are usually
+ resolved relative to this
+ --big-tables Allow big result sets by saving all temporary sets on
+ file (Solves most 'table full' errors)
+ --bind-address=name IP address to bind to.
+ --binlog-cache-size=#
+ The size of the cache to hold the SQL statements for the
+ binary log during a transaction. If you often use big,
+ multi-statement transactions you can increase this to get
+ more performance
+ --binlog-do-db=name Tells the master it should log updates for the specified
+ database, and exclude all others not explicitly
+ mentioned.
+ --binlog-format=name
+ What form of binary logging the master will use: either
+ ROW for row-based binary logging, STATEMENT for
+ statement-based binary logging, or MIXED. MIXED is
+ statement-based binary logging except for those
+ statements where only row-based is correct: those which
+ involve user-defined functions (i.e. UDFs) or the UUID()
+ function; for those, row-based binary logging is
+ automatically used. If NDBCLUSTER is enabled and
+ binlog-format is MIXED, the format switches to row-based
+ and back implicitly per each query accessing an
+ NDBCLUSTER table
+ --binlog-ignore-db=name
+ Tells the master that updates to the given database
+ should not be logged tothe binary log.
+ --binlog-row-event-max-size=#
+ The maximum size of a row-based binary log event in
+ bytes. Rows will be grouped into events smaller than this
+ size if possible. The value has to be a multiple of 256.
+ --blackhole[=name] Enable or disable BLACKHOLE plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --bootstrap Used by mysql installation scripts.
+ --bulk-insert-buffer-size=#
+ Size of tree cache used in bulk insert optimisation. Note
+ that this is a limit per thread!
+ --character-set-client-handshake
+ Don't ignore client side character set value sent during
+ handshake.
+ (Defaults to on; use --skip-character-set-client-handshake to disable.)
+ --character-set-filesystem=name
+ Set the filesystem character set.
+ -C, --character-set-server=name
+ Set the default character set.
+ --character-sets-dir=name
+ Directory where character sets are
+ -r, --chroot=name Chroot mysqld daemon during startup.
+ --collation-server=name
+ Set the default collation.
+ --completion-type=name
+ The transaction completion type, one of NO_CHAIN, CHAIN,
+ RELEASE
+ --concurrent-insert[=name]
+ Use concurrent insert with MyISAM. Possible values are
+ NEVER, AUTO, ALWAYS
+ --connect-timeout=# The number of seconds the mysqld server is waiting for a
+ connect packet before responding with 'Bad handshake'
+ --console Write error output on screen; Don't remove the console
+ window on windows.
+ --core-file Write core on errors.
+ -h, --datadir=name Path to the database root directory
+ --date-format=name The DATE format (ignored)
+ --datetime-format=name
+ The DATETIME format (ignored)
+ -C, --default-character-set=name
+ Set the default character set (deprecated option, use
+ --character-set-server instead).
+ --default-collation=name
+ Set the default collation (deprecated option, use
+ --collation-server instead).
+ --default-storage-engine=name
+ The default storage engine for new tables
+ --default-time-zone=name
+ Set the default time zone.
+ --default-week-format=#
+ The default week format used by WEEK() functions
+ --delay-key-write[=name]
+ Type of DELAY_KEY_WRITE
+ --delay-key-write-for-all-tables
+ Don't flush key buffers between writes for any MyISAM
+ table (Deprecated option, use --delay-key-write=all
+ instead).
+ --delayed-insert-limit=#
+ After inserting delayed_insert_limit rows, the INSERT
+ DELAYED handler will check if there are any SELECT
+ statements pending. If so, it allows these to execute
+ before continuing
+ --delayed-insert-timeout=#
+ How long a INSERT DELAYED thread should wait for INSERT
+ statements before terminating
+ --delayed-queue-size=#
+ What size queue (in rows) should be allocated for
+ handling INSERT DELAYED. If the queue becomes full, any
+ client that does INSERT DELAYED will wait until there is
+ room in the queue again
+ --disconnect-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --div-precision-increment=#
+ Precision of the result of '/' operator will be increased
+ on that value
+ --enable-locking Deprecated option, use --external-locking instead.
+ --engine-condition-pushdown
+ Push supported query conditions to the storage engine.
+ Deprecated, use --optimizer-switch instead.
+ (Defaults to on; use --skip-engine-condition-pushdown to disable.)
+ --event-scheduler[=name]
+ Enable the event scheduler. Possible values are ON, OFF,
+ and DISABLED (keep the event scheduler completely
+ deactivated, it cannot be activated run-time)
+ -T, --exit-info[=#] Used for debugging; Use at your own risk!
+ --expire-logs-days=#
+ If non-zero, binary logs will be purged after
+ expire_logs_days days; possible purges happen at startup
+ and at binary log rotation
+ --external-locking Use system (external) locking (disabled by default).
+ With this option enabled you can run myisamchk to test
+ (not repair) tables while the MySQL server is running.
+ Disable with --skip-external-locking.
+ --federated[=name] Enable or disable FEDERATED plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --flush Flush MyISAM tables to disk between SQL commands
+ --flush-time=# A dedicated thread is created to flush all tables at the
+ given interval
+ --ft-boolean-syntax=name
+ List of operators for MATCH ... AGAINST ( ... IN BOOLEAN
+ MODE)
+ --ft-max-word-len=# The maximum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-min-word-len=# The minimum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-query-expansion-limit=#
+ Number of best matches to use for query expansion
+ --ft-stopword-file=name
+ Use stopwords from this file instead of built-in list
+ --gdb Set up signals usable for debugging
+ --general-log Log connections and queries to a table or log file.
+ Defaults logging to a file hostname.log or a table
+ mysql.general_logif --log-output=TABLE is used
+ --general-log-file=name
+ Log connections and queries to given file
+ --group-concat-max-len=#
+ The maximum length of the result of function
+ GROUP_CONCAT()
+ -?, --help Display this help and exit.
+ --ignore-builtin-innodb
+ Disable initialization of builtin InnoDB plugin
+ --init-connect=name Command(s) that are executed for each new connection
+ --init-file=name Read SQL commands from this file at startup
+ --init-rpl-role=name
+ Set the replication role.
+ --init-slave=name Command(s) that are executed by a slave server each time
+ the SQL thread starts
+ --interactive-timeout=#
+ The number of seconds the server waits for activity on an
+ interactive connection before closing it
+ --join-buffer-size=#
+ The size of the buffer that is used for full joins
+ --keep-files-on-create
+ Don't overwrite stale .MYD and .MYI even if no directory
+ is specified
+ --key-buffer-size=# The size of the buffer used for index blocks for MyISAM
+ tables. Increase this to get better index handling (for
+ all reads and multiple writes) to as much as you can
+ afford
+ --key-cache-age-threshold=#
+ This characterizes the number of hits a hot block has to
+ be untouched until it is considered aged enough to be
+ downgraded to a warm block. This specifies the percentage
+ ratio of that number of hits to the total number of
+ blocks in key cache
+ --key-cache-block-size=#
+ The default size of key cache blocks
+ --key-cache-division-limit=#
+ The minimum percentage of warm blocks in key cache
+ -L, --language=name Client error messages in given language. May be given as
+ a full path. Deprecated. Use --lc-messages-dir instead.
+ --large-pages Enable support for large pages
+ --lc-messages=name Set the language used for the error messages.
+ -L, --lc-messages-dir=name
+ Directory where error messages are
+ --lc-time-names=name
+ Set the language used for the month names and the days of
+ the week.
+ --local-infile Enable LOAD DATA LOCAL INFILE
+ (Defaults to on; use --skip-local-infile to disable.)
+ -l, --log[=name] Log connections and queries to file (deprecated option,
+ use --general-log/--general-log-file instead).
+ --log-bin[=name] Log update queries in binary format. Optional (but
+ strongly recommended to avoid replication problems if
+ server's hostname changes) argument should be the chosen
+ location for the binary log files.
+ --log-bin-index=name
+ File that holds the names for last binary log files.
+ --log-bin-trust-function-creators
+ If set to FALSE (the default), then when --log-bin is
+ used, creation of a stored function (or trigger) is
+ allowed only to users having the SUPER privilege and only
+ if this stored function (trigger) may not break binary
+ logging. Note that if ALL connections to this server
+ ALWAYS use row-based binary logging, the security issues
+ do not exist and the binary logging cannot break, so you
+ can safely set this to TRUE
+ --log-error[=name] Error log file
+ --log-isam[=name] Log all MyISAM changes to file.
+ -0, --log-long-format
+ Log some extra information to update log. Please note
+ that this option is deprecated; see --log-short-format
+ option.
+ --log-output=name Syntax: log-output=value[,value...], where "value" could
+ be TABLE, FILE or NONE
+ --log-queries-not-using-indexes
+ Log queries that are executed without benefit of any
+ index to the slow log if it is open
+ --log-short-format Don't log extra information to update and slow-query
+ logs.
+ --log-slave-updates Tells the slave to log the updates from the slave thread
+ to the binary log. You will need to turn it on if you
+ plan to daisy-chain the slaves
+ --log-slow-admin-statements
+ Log slow OPTIMIZE, ANALYZE, ALTER and other
+ administrative statements to the slow log if it is open.
+ --log-slow-queries[=name]
+ Log slow queries to a table or log file. Defaults logging
+ to table mysql.slow_log or hostname-slow.log if
+ --log-output=file is used. Must be enabled to activate
+ other slow log options. Deprecated option, use
+ --slow-query-log/--slow-query-log-file instead.
+ --log-slow-slave-statements
+ Log slow statements executed by slave thread to the slow
+ log if it is open.
+ --log-tc=name Path to transaction coordinator log (used for
+ transactions that affect more than one storage engine,
+ when binary log is disabled)
+ --log-tc-size=# Size of transaction coordinator log.
+ --log-update[=name] The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option justs turns on
+ --log-bin instead.
+ -W, --log-warnings[=#]
+ Log some not critical warnings to the log file
+ --long-query-time=# Log all queries that have taken more than long_query_time
+ seconds to execute to file. The argument will be treated
+ as a decimal value with microsecond precision
+ --low-priority-updates
+ INSERT/DELETE/UPDATE has lower priority than selects
+ --lower-case-table-names[=#]
+ If set to 1 table names are stored in lowercase on disk
+ and table names will be case-insensitive. Should be set
+ to 2 if you are using a case insensitive file system
+ --master-info-file=name
+ The location and name of the file that remembers the
+ master and where the I/O replication thread is in the
+ master's binlogs.
+ --master-retry-count=#
+ The number of tries the slave will make to connect to the
+ master before giving up.
+ --max-allowed-packet=#
+ Max packet length to send to or receive from the server
+ --max-binlog-cache-size=#
+ Can be used to restrict the total size used to cache a
+ multi-transaction query
+ --max-binlog-dump-events=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --max-binlog-size=# Binary log will be rotated automatically when the size
+ exceeds this value. Will also apply to relay logs if
+ max_relay_log_size is 0
+ --max-connect-errors=#
+ If there is more than this number of interrupted
+ connections from a host this host will be blocked from
+ further connections
+ --max-connections=# The number of simultaneous clients allowed
+ --max-delayed-threads=#
+ Don't start more than this number of threads to handle
+ INSERT DELAYED statements. If set to zero INSERT DELAYED
+ will be not used
+ --max-error-count=# Max number of errors/warnings to store for a statement
+ --max-heap-table-size=#
+ Don't allow creation of heap tables bigger than this
+ --max-join-size=# Joins that are probably going to read more than
+ max_join_size records return an error
+ --max-length-for-sort-data=#
+ Max number of bytes in sorted records
+ --max-prepared-stmt-count=#
+ Maximum number of prepared statements in the server
+ --max-relay-log-size=#
+ If non-zero: relay log will be rotated automatically when
+ the size exceeds this value; if zero: when the size
+ exceeds max_binlog_size
+ --max-seeks-for-key=#
+ Limit assumed max number of seeks when looking up rows
+ based on a key
+ --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
+ values (only the first max_sort_length bytes of each
+ value are used; the rest are ignored)
+ --max-sp-recursion-depth[=#]
+ Maximum stored procedure recursion depth
+ --max-tmp-tables=# Maximum number of temporary tables a client can keep open
+ at a time
+ --max-user-connections=#
+ The maximum number of active connections for a single
+ user (0 = no limit)
+ --max-write-lock-count=#
+ After this many write locks, allow some read locks to run
+ in between
+ --memlock Lock mysqld in memory.
+ --min-examined-row-limit=#
+ Don't write queries to slow log that examine fewer rows
+ than that
+ --multi-range-count=#
+ Number of key ranges to request at once
+ --myisam-block-size=#
+ Block size to be used for MyISAM index pages
+ --myisam-data-pointer-size=#
+ Default pointer size to be used for MyISAM tables
+ --myisam-max-sort-file-size=#
+ Don't use the fast sort index method to created index if
+ the temporary file would get bigger than this
+ --myisam-mmap-size=#
+ Restricts the total memory used for memory mapping of
+ MySQL tables
+ --myisam-recover-options[=name]
+ Syntax: myisam-recover-options[=option[,option...]],
+ where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF
+ --myisam-repair-threads=#
+ If larger than 1, when repairing a MyISAM table all
+ indexes will be created in parallel, with one thread per
+ index. The value of 1 disables parallel repair
+ --myisam-sort-buffer-size=#
+ The buffer that is allocated when sorting the index when
+ doing a REPAIR or when creating indexes with CREATE INDEX
+ or ALTER TABLE
+ --myisam-stats-method=name
+ Specifies how MyISAM index statistics collection code
+ should treat NULLs. Possible values of name are
+ NULLS_UNEQUAL (default behavior for 4.1 and later),
+ NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
+ --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
+ --net-buffer-length=#
+ Buffer length for TCP/IP and socket communication
+ --net-read-timeout=#
+ Number of seconds to wait for more data from a connection
+ before aborting the read
+ --net-retry-count=# If a read on a communication port is interrupted, retry
+ this many times before giving up
+ --net-write-timeout=#
+ Number of seconds to wait for a block to be written to a
+ connection before aborting the write
+ -n, --new Use very new possible "unsafe" functions
+ --old Use compatible behavior
+ --old-alter-table Use old, non-optimized alter table
+ --old-passwords Use old password encryption method (needed for 4.0 and
+ older clients)
+ --old-style-user-limits
+ Enable old-style user limits (before 5.0.3 user resources
+ were counted per each user+host vs. per account)
+ --one-thread (deprecated): Only use one thread (for debugging under
+ Linux). Use thread-handling=no-threads instead
+ --open-files-limit=#
+ If this is not 0, then mysqld will use this value to
+ reserve file descriptors to use with setrlimit(). If this
+ value is 0 then mysqld will reserve max_connections*5 or
+ max_connections + table_cache*2 (whichever is larger)
+ number of file descriptors
+ --optimizer-prune-level=#
+ Controls the heuristic(s) applied during query
+ optimization to prune less-promising partial plans from
+ the optimizer search space. Meaning: 0 - do not apply any
+ heuristic, thus perform exhaustive search; 1 - prune
+ plans based on number of retrieved rows
+ --optimizer-search-depth=#
+ Maximum depth of search performed by the query optimizer.
+ Values larger than the number of relations in a query
+ result in better query plans, but take longer to compile
+ a query. Values smaller than the number of tables in a
+ relation result in faster optimization, but may produce
+ very bad query plans. If set to 0, the system will
+ automatically pick a reasonable value; if set to 63, the
+ optimizer will switch to the original find_best
+ search(used for testing/comparison)
+ --optimizer-switch=name
+ optimizer_switch=option=val[,option=val...], where option
+ is one of {index_merge, index_merge_union,
+ index_merge_sort_union, index_merge_intersection,
+ engine_condition_pushdown} and val is one of {on, off,
+ default}
+ --partition[=name] Enable or disable partition plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --performance-schema
+ Enable the performance schema.
+ --performance-schema-events-waits-history-long-size=#
+ Number of rows in EVENTS_WAITS_HISTORY_LONG.
+ --performance-schema-events-waits-history-size=#
+ Number of rows per thread in EVENTS_WAITS_HISTORY.
+ --performance-schema-max-cond-classes=#
+ Maximum number of condition instruments.
+ --performance-schema-max-cond-instances=#
+ Maximum number of instrumented condition objects.
+ --performance-schema-max-file-classes=#
+ Maximum number of file instruments.
+ --performance-schema-max-file-handles=#
+ Maximum number of opened instrumented files.
+ --performance-schema-max-file-instances=#
+ Maximum number of instrumented files.
+ --performance-schema-max-mutex-classes=#
+ Maximum number of mutex instruments.
+ --performance-schema-max-mutex-instances=#
+ Maximum number of instrumented MUTEX objects.
+ --performance-schema-max-rwlock-classes=#
+ Maximum number of rwlock instruments.
+ --performance-schema-max-rwlock-instances=#
+ Maximum number of instrumented RWLOCK objects.
+ --performance-schema-max-table-handles=#
+ Maximum number of opened instrumented tables.
+ --performance-schema-max-table-instances=#
+ Maximum number of instrumented tables.
+ --performance-schema-max-thread-classes=#
+ Maximum number of thread instruments.
+ --performance-schema-max-thread-instances=#
+ Maximum number of instrumented threads.
+ --pid-file=name Pid file used by safe_mysqld
+ --plugin-dir=name Directory for plugins
+ --plugin-load=name Optional semicolon-separated list of plugins to load,
+ where each plugin is identified as name=library, where
+ name is the plugin name and library is the plugin library
+ in plugin_dir.
+ -P, --port=# Port number to use for connection or 0 to default to,
+ my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
+ (3306), whatever comes first
+ --port-open-timeout=#
+ Maximum time in seconds to wait for the port to become
+ free. (Default: no wait)
+ --preload-buffer-size=#
+ The size of the buffer that is allocated when preloading
+ indexes
+ --profiling-history-size=#
+ Limit of query profiling memory
+ --query-alloc-block-size=#
+ Allocation block size for query parsing and execution
+ --query-cache-limit=#
+ Don't cache results that are bigger than this
+ --query-cache-min-res-unit=#
+ The minimum size for blocks allocated by the query cache
+ --query-cache-size=#
+ The memory allocated to store results from old queries
+ --query-cache-type=name
+ OFF = Don't cache or retrieve results. ON = Cache all
+ results except SELECT SQL_NO_CACHE ... queries. DEMAND =
+ Cache only SELECT SQL_CACHE ... queries
+ --query-cache-wlock-invalidate
+ Invalidate queries in query cache on LOCK for write
+ --query-prealloc-size=#
+ Persistent buffer for query parsing and execution
+ --range-alloc-block-size=#
+ Allocation block size for storing ranges during
+ optimization
+ --read-buffer-size=#
+ Each thread that does a sequential scan allocates a
+ buffer of this size for each table it scans. If you do
+ many sequential scans, you may want to increase this
+ value
+ --read-only Make all non-temporary tables read-only, with the
+ exception for replication (slave) threads and users with
+ the SUPER privilege
+ --read-rnd-buffer-size=#
+ When reading rows in sorted order after a sort, the rows
+ are read through this buffer to avoid a disk seeks. If
+ not set, then it's set to the value of record_buffer
+ --record-buffer=# Deprecated; use --read-buffer-size instead.
+ --relay-log=name The location and name to use for relay logs
+ --relay-log-index=name
+ The location and name to use for the file that keeps a
+ list of the last relay logs
+ --relay-log-info-file=name
+ The location and name of the file that remembers where
+ the SQL replication thread is in the relay logs
+ --relay-log-purge if disabled - do not purge relay logs. if enabled - purge
+ them as soon as they are no more needed
+ (Defaults to on; use --skip-relay-log-purge to disable.)
+ --relay-log-recovery
+ Enables automatic relay log recovery right after the
+ database startup, which means that the IO Thread starts
+ re-fetching from the master right after the last
+ transaction processed
+ --relay-log-space-limit=#
+ Maximum space to use for all relay logs
+ --replicate-do-db=name
+ Tells the slave thread to restrict replication to the
+ specified database. To specify more than one database,
+ use the directive multiple times, once for each database.
+ Note that this will only work if you do not use
+ cross-database queries such as UPDATE some_db.some_table
+ SET foo='bar' while having selected a different or no
+ database. If you need cross database updates to work,
+ make sure you have 3.23.28 or later, and use
+ replicate-wild-do-table=db_name.%.
+ --replicate-do-table=name
+ Tells the slave thread to restrict replication to the
+ specified table. To specify more than one table, use the
+ directive multiple times, once for each table. This will
+ work for cross-database updates, in contrast to
+ replicate-do-db.
+ --replicate-ignore-db=name
+ Tells the slave thread to not replicate to the specified
+ database. To specify more than one database to ignore,
+ use the directive multiple times, once for each database.
+ This option will not work if you use cross database
+ updates. If you need cross database updates to work, make
+ sure you have 3.23.28 or later, and use
+ replicate-wild-ignore-table=db_name.%.
+ --replicate-ignore-table=name
+ Tells the slave thread to not replicate to the specified
+ table. To specify more than one table to ignore, use the
+ directive multiple times, once for each table. This will
+ work for cross-datbase updates, in contrast to
+ replicate-ignore-db.
+ --replicate-rewrite-db=name
+ Updates to a database with a different name than the
+ original. Example:
+ replicate-rewrite-db=master_db_name->slave_db_name.
+ --replicate-same-server-id
+ In replication, if set to 1, do not skip events having
+ our server id. Default value is 0 (to break infinite
+ loops in circular replication). Can't be set to 1 if
+ --log-slave-updates is used.
+ --replicate-wild-do-table=name
+ Tells the slave thread to restrict replication to the
+ tables that match the specified wildcard pattern. To
+ specify more than one table, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-do-table=foo%.bar% will replicate only
+ updates to tables in all databases that start with foo
+ and whose table names start with bar.
+ --replicate-wild-ignore-table=name
+ Tells the slave thread to not replicate to the tables
+ that match the given wildcard pattern. To specify more
+ than one table to ignore, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-ignore-table=foo%.bar% will not do updates
+ to tables in databases that start with foo and whose
+ table names start with bar.
+ --report-host=name Hostname or IP of the slave to be reported to the master
+ during slave registration. Will appear in the output of
+ SHOW SLAVE HOSTS. Leave unset if you do not want the
+ slave to register itself with the master. Note that it is
+ not sufficient for the master to simply read the IP of
+ the slave off the socket once the slave connects. Due to
+ NAT and other routing issues, that IP may not be valid
+ for connecting to the slave from the master or other
+ hosts
+ --report-password=name
+ The account password of the slave to be reported to the
+ master during slave registration
+ --report-port=# Port for connecting to slave reported to the master
+ during slave registration. Set it only if the slave is
+ listening on a non-default port or if you have a special
+ tunnel from the master or other clients to the slave. If
+ not sure, leave this option unset
+ --report-user=name The account user name of the slave to be reported to the
+ master during slave registration
+ --rpl-recovery-rank=#
+ Unused, will be removed
+ --safe-mode Skip some optimize stages (for testing).
+ --safe-show-database
+ Deprecated option; use GRANT SHOW DATABASES instead...
+ --safe-user-create Don't allow new user creation by the user who has no
+ write privileges to the mysql.user table.
+ --secure-auth Disallow authentication for accounts that have old
+ (pre-4.1) passwords
+ --secure-file-priv=name
+ Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
+ files within specified directory
+ --server-id=# Uniquely identifies the server instance in the community
+ of replication partners
+ -O, --set-variable=name
+ Change the value of a variable. Please note that this
+ option is deprecated;you can set variables directly with
+ --variable-name=value.
+ --show-slave-auth-info
+ Show user and password in SHOW SLAVE HOSTS on this master
+ --skip-grant-tables Start without grant tables. This gives all users FULL
+ ACCESS to all tables!
+ --skip-host-cache Don't cache host names.
+ --skip-locking Deprecated option, use --skip-external-locking instead.
+ --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
+ 'localhost'.
+ --skip-networking Don't allow connection with TCP/IP
+ --skip-new Don't use new, possible wrong routines.
+ --skip-show-database
+ Don't allow 'SHOW DATABASE' commands
+ --skip-slave-start If set, slave is not autostarted.
+ --skip-stack-trace Don't print a stack trace on failure.
+ --skip-symlink Don't allow symlinking of tables. Deprecated option. Use
+ --skip-symbolic-links instead.
+ --skip-thread-priority
+ Don't give threads different priorities. This option is
+ deprecated because it has no effect; the implied behavior
+ is already the default.
+ --slave-compressed-protocol
+ Use compression on master/slave protocol
+ --slave-exec-mode=name
+ Modes for how replication events should be executed.
+ Legal values are STRICT (default) and IDEMPOTENT. In
+ IDEMPOTENT mode, replication will not stop for operations
+ that are idempotent. In STRICT mode, replication will
+ stop on any unexpected difference between the master and
+ the slave
+ --slave-load-tmpdir=name
+ The location where the slave should put its temporary
+ files when replicating a LOAD DATA INFILE command
+ --slave-net-timeout=#
+ Number of seconds to wait for more data from a
+ master/slave connection before aborting the read
+ --slave-skip-errors=name
+ Tells the slave thread to continue replication when a
+ query event returns an error from the provided list
+ --slave-transaction-retries=#
+ Number of times the slave SQL thread will retry a
+ transaction in case it failed with a deadlock or elapsed
+ lock wait timeout, before giving up and stopping
+ --slave-type-conversions=name
+ Set of slave type conversions that are enabled. Legal
+ values are: ALL_LOSSY to enable lossy conversions and
+ ALL_NON_LOSSY to enable non-lossy conversions. If the
+ variable is assigned the empty set, no conversions are
+ allowed and it is expected that the types match exactly.
+ --slow-launch-time=#
+ If creating the thread takes longer than this value (in
+ seconds), the Slow_launch_threads counter will be
+ incremented
+ --slow-query-log Log slow queries to a table or log file. Defaults logging
+ to a file hostname-slow.log or a table mysql.slow_log if
+ --log-output=TABLE is used. Must be enabled to activate
+ other slow log options
+ --slow-query-log-file=name
+ Log slow queries to given log file. Defaults logging to
+ hostname-slow.log. Must be enabled to activate other slow
+ log options
+ --socket=name Socket file to use for connection
+ --sort-buffer-size=#
+ Each thread that needs to do a sort allocates a buffer of
+ this size
+ --sporadic-binlog-dump-fail
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --sql-bin-update-same
+ The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option does nothing
+ anymore.
+ --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual
+ for the complete list of valid sql modes
+ -s, --symbolic-links
+ Enable symbolic link support.
+ --sync-binlog=# Synchronously flush binary log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-frm Sync .frm files to disk on creation
+ (Defaults to on; use --skip-sync-frm to disable.)
+ --sync-master-info=#
+ Synchronously flush master info to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log=# Synchronously flush relay log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log-info=#
+ Synchronously flush relay log info to disk after every
+ #th transaction. Use 0 (default) to disable synchronous
+ flushing
+ --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it
+ safe-replicable. Since 5.0, SYSDATE() returns a `dynamic'
+ value different for different invocations, even within
+ the same statement.
+ --table-cache=# Deprecated; use --table-open-cache instead.
+ --table-definition-cache=#
+ The number of cached table definitions
+ --table-lock-wait-timeout=#
+ Timeout in seconds to wait for a table level lock before
+ returning an error. Used only if the connection has
+ active cursors
+ --table-open-cache=#
+ The number of cached open tables
+ --tc-heuristic-recover=name
+ Decision to use in heuristic recover process. Possible
+ values are COMMIT or ROLLBACK.
+ --thread-cache-size=#
+ How many threads we should keep in a cache for reuse
+ --thread-handling=name
+ Define threads usage for handling queries, one of
+ one-thread-per-connection, no-threads
+ --thread-stack=# The stack size for each thread
+ --time-format=name The TIME format (ignored)
+ --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are
+ currently supported)
+ --tmp-table-size=# If an internal in-memory temporary table exceeds this
+ size, MySQL will automatically convert it to an on-disk
+ MyISAM table
+ -t, --tmpdir=name Path for temporary files. Several paths may be specified,
+ separated by a colon (:), in this case they are used in a
+ round-robin fashion
+ --transaction-alloc-block-size=#
+ Allocation block size for transactions to be stored in
+ binary log
+ --transaction-isolation=name
+ Default transaction isolation level.
+ --transaction-prealloc-size=#
+ Persistent buffer for transactions to be stored in binary
+ log
+ --updatable-views-with-limit=name
+ YES = Don't issue an error message (warning only) if a
+ VIEW without presence of a key of the underlying table is
+ used in queries with a LIMIT clause for updating. NO =
+ Prohibit update of a VIEW, which does not contain a key
+ of the underlying table and the query uses a LIMIT clause
+ (usually get from GUI tools)
+ -s, --use-symbolic-links
+ Enable symbolic link support. Deprecated option; use
+ --symbolic-links instead.
+ -u, --user=name Run mysqld daemon as user.
+ -v, --verbose Used with --help option for detailed help
+ -V, --version Output version information and exit.
+ --wait-timeout=# The number of seconds the server waits for activity on a
+ connection before closing it
+ -W, --warnings[=#] Deprecated; use --log-warnings instead.
+
+Variables (--variable-name=value)
+and boolean options {FALSE|TRUE} Value (after reading options)
+------------------------------------------------- ------------------------
+abort-slave-event-count 0
+allow-suspicious-udfs FALSE
+archive ON
+auto-increment-increment 1
+auto-increment-offset 1
+automatic-sp-privileges TRUE
+back-log 50
+big-tables FALSE
+bind-address (No default value)
+binlog-cache-size 32768
+binlog-format STATEMENT
+binlog-row-event-max-size 1024
+blackhole ON
+bulk-insert-buffer-size 8388608
+character-set-client-handshake TRUE
+character-set-filesystem binary
+character-set-server latin1
+character-sets-dir MYSQL_SHAREDIR/charsets/
+chroot (No default value)
+collation-server latin1_swedish_ci
+completion-type NO_CHAIN
+concurrent-insert AUTO
+connect-timeout 10
+console FALSE
+date-format %Y-%m-%d
+datetime-format %Y-%m-%d %H:%i:%s
+default-character-set latin1
+default-collation latin1_swedish_ci
+default-storage-engine MyISAM
+default-time-zone (No default value)
+default-week-format 0
+delay-key-write ON
+delayed-insert-limit 100
+delayed-insert-timeout 300
+delayed-queue-size 1000
+disconnect-slave-event-count 0
+div-precision-increment 4
+enable-locking FALSE
+engine-condition-pushdown TRUE
+event-scheduler OFF
+expire-logs-days 0
+external-locking FALSE
+federated ON
+flush FALSE
+flush-time 0
+ft-boolean-syntax + -><()~*:""&|
+ft-max-word-len 84
+ft-min-word-len 4
+ft-query-expansion-limit 20
+ft-stopword-file (No default value)
+gdb FALSE
+general-log FALSE
+group-concat-max-len 1024
+help TRUE
+ignore-builtin-innodb FALSE
+init-connect
+init-file (No default value)
+init-rpl-role MASTER
+init-slave
+interactive-timeout 28800
+join-buffer-size 131072
+keep-files-on-create FALSE
+key-buffer-size 8388608
+key-cache-age-threshold 300
+key-cache-block-size 1024
+key-cache-division-limit 100
+language MYSQL_SHAREDIR/
+large-pages FALSE
+lc-messages en_US
+lc-messages-dir MYSQL_SHAREDIR/
+lc-time-names en_US
+local-infile TRUE
+log-bin (No default value)
+log-bin-index (No default value)
+log-bin-trust-function-creators FALSE
+log-error
+log-isam myisam.log
+log-output FILE
+log-queries-not-using-indexes FALSE
+log-short-format FALSE
+log-slave-updates FALSE
+log-slow-admin-statements FALSE
+log-slow-slave-statements FALSE
+log-tc tc.log
+log-tc-size 24576
+log-update (No default value)
+log-warnings 1
+long-query-time 10
+low-priority-updates FALSE
+lower-case-table-names 1
+master-info-file master.info
+master-retry-count 86400
+max-allowed-packet 1048576
+max-binlog-cache-size 18446744073709547520
+max-binlog-dump-events 0
+max-binlog-size 1073741824
+max-connect-errors 10
+max-connections 151
+max-delayed-threads 20
+max-error-count 64
+max-heap-table-size 16777216
+max-join-size 18446744073709551615
+max-length-for-sort-data 1024
+max-prepared-stmt-count 16382
+max-relay-log-size 0
+max-seeks-for-key 18446744073709551615
+max-sort-length 1024
+max-sp-recursion-depth 0
+max-tmp-tables 32
+max-user-connections 0
+max-write-lock-count 18446744073709551615
+memlock FALSE
+min-examined-row-limit 0
+multi-range-count 256
+myisam-block-size 1024
+myisam-data-pointer-size 6
+myisam-max-sort-file-size 9223372036853727232
+myisam-mmap-size 18446744073709551615
+myisam-recover-options OFF
+myisam-repair-threads 1
+myisam-sort-buffer-size 8388608
+myisam-stats-method nulls_unequal
+myisam-use-mmap FALSE
+net-buffer-length 16384
+net-read-timeout 30
+net-retry-count 10
+net-write-timeout 60
+new FALSE
+old FALSE
+old-alter-table FALSE
+old-passwords FALSE
+old-style-user-limits FALSE
+optimizer-prune-level 1
+optimizer-search-depth 62
+optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+partition ON
+performance-schema FALSE
+performance-schema-events-waits-history-long-size 10000
+performance-schema-events-waits-history-size 10
+performance-schema-max-cond-classes 80
+performance-schema-max-cond-instances 1000
+performance-schema-max-file-classes 50
+performance-schema-max-file-handles 32768
+performance-schema-max-file-instances 10000
+performance-schema-max-mutex-classes 200
+performance-schema-max-mutex-instances 1000
+performance-schema-max-rwlock-classes 20
+performance-schema-max-rwlock-instances 1000
+performance-schema-max-table-handles 100000
+performance-schema-max-table-instances 50000
+performance-schema-max-thread-classes 50
+performance-schema-max-thread-instances 1000
+plugin-dir MYSQL_LIBDIR/mysql/plugin
+plugin-load (No default value)
+port 3306
+port-open-timeout 0
+preload-buffer-size 32768
+profiling-history-size 15
+query-alloc-block-size 8192
+query-cache-limit 1048576
+query-cache-min-res-unit 4096
+query-cache-size 0
+query-cache-type ON
+query-cache-wlock-invalidate FALSE
+query-prealloc-size 8192
+range-alloc-block-size 4096
+read-buffer-size 131072
+read-only FALSE
+read-rnd-buffer-size 262144
+record-buffer 131072
+relay-log (No default value)
+relay-log-index (No default value)
+relay-log-info-file relay-log.info
+relay-log-purge TRUE
+relay-log-recovery FALSE
+relay-log-space-limit 0
+replicate-same-server-id FALSE
+report-host (No default value)
+report-password (No default value)
+report-port 3306
+report-user (No default value)
+rpl-recovery-rank 0
+safe-user-create FALSE
+secure-auth FALSE
+secure-file-priv (No default value)
+server-id 0
+show-slave-auth-info FALSE
+skip-grant-tables TRUE
+skip-networking FALSE
+skip-show-database FALSE
+skip-slave-start FALSE
+slave-compressed-protocol FALSE
+slave-exec-mode STRICT
+slave-net-timeout 3600
+slave-skip-errors (No default value)
+slave-transaction-retries 10
+slave-type-conversions
+slow-launch-time 2
+slow-query-log FALSE
+socket /tmp/mysql.sock
+sort-buffer-size 2097152
+sporadic-binlog-dump-fail FALSE
+sql-mode
+symbolic-links FALSE
+sync-binlog 0
+sync-frm TRUE
+sync-master-info 0
+sync-relay-log 0
+sync-relay-log-info 0
+sysdate-is-now FALSE
+table-cache 400
+table-definition-cache 400
+table-lock-wait-timeout 50
+table-open-cache 400
+tc-heuristic-recover COMMIT
+thread-cache-size 0
+thread-handling one-thread-per-connection
+thread-stack 262144
+time-format %H:%i:%s
+timed-mutexes FALSE
+tmp-table-size 16777216
+transaction-alloc-block-size 8192
+transaction-isolation REPEATABLE-READ
+transaction-prealloc-size 4096
+updatable-views-with-limit YES
+use-symbolic-links FALSE
+verbose TRUE
+wait-timeout 28800
+warnings 1
+
+To see what values a running MySQL server is using, type
+'mysqladmin variables' instead of 'mysqld --verbose --help'.
diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result
new file mode 100644
index 00000000000..7e261fc203c
--- /dev/null
+++ b/mysql-test/r/mysqld--help-win.result
@@ -0,0 +1,998 @@
+The following options may be given as the first argument:
+--print-defaults Print the program argument list and exit
+--no-defaults Don't read default options from any options file
+--defaults-file=# Only read default options from the given file #
+--defaults-extra-file=# Read this file after the global files are read
+
+ --abort-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --allow-suspicious-udfs
+ Allows use of UDFs consisting of only one symbol xxx()
+ without corresponding xxx_init() or xxx_deinit(). That
+ also means that one can load any function from any
+ library, for example exit() from libc.so
+ -a, --ansi Use ANSI SQL syntax instead of MySQL syntax. This mode
+ will also set transaction isolation level 'serializable'.
+ --archive[=name] Enable or disable ARCHIVE plugin. Possible values are ON,
+ OFF, FORCE (don't start if the plugin fails to load).
+ --auto-increment-increment[=#]
+ Auto-increment columns are incremented by this
+ --auto-increment-offset[=#]
+ Offset added to Auto-increment columns. Used when
+ auto-increment-increment != 1
+ --automatic-sp-privileges
+ Creating and dropping stored procedures alters ACLs
+ (Defaults to on; use --skip-automatic-sp-privileges to disable.)
+ --back-log=# The number of outstanding connection requests MySQL can
+ have. This comes into play when the main MySQL thread
+ gets very many connection requests in a very short time
+ -b, --basedir=name Path to installation directory. All paths are usually
+ resolved relative to this
+ --big-tables Allow big result sets by saving all temporary sets on
+ file (Solves most 'table full' errors)
+ --bind-address=name IP address to bind to.
+ --binlog-cache-size=#
+ The size of the cache to hold the SQL statements for the
+ binary log during a transaction. If you often use big,
+ multi-statement transactions you can increase this to get
+ more performance
+ --binlog-do-db=name Tells the master it should log updates for the specified
+ database, and exclude all others not explicitly
+ mentioned.
+ --binlog-format=name
+ What form of binary logging the master will use: either
+ ROW for row-based binary logging, STATEMENT for
+ statement-based binary logging, or MIXED. MIXED is
+ statement-based binary logging except for those
+ statements where only row-based is correct: those which
+ involve user-defined functions (i.e. UDFs) or the UUID()
+ function; for those, row-based binary logging is
+ automatically used. If NDBCLUSTER is enabled and
+ binlog-format is MIXED, the format switches to row-based
+ and back implicitly per each query accessing an
+ NDBCLUSTER table
+ --binlog-ignore-db=name
+ Tells the master that updates to the given database
+ should not be logged tothe binary log.
+ --binlog-row-event-max-size=#
+ The maximum size of a row-based binary log event in
+ bytes. Rows will be grouped into events smaller than this
+ size if possible. The value has to be a multiple of 256.
+ --blackhole[=name] Enable or disable BLACKHOLE plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --bootstrap Used by mysql installation scripts.
+ --bulk-insert-buffer-size=#
+ Size of tree cache used in bulk insert optimisation. Note
+ that this is a limit per thread!
+ --character-set-client-handshake
+ Don't ignore client side character set value sent during
+ handshake.
+ (Defaults to on; use --skip-character-set-client-handshake to disable.)
+ --character-set-filesystem=name
+ Set the filesystem character set.
+ -C, --character-set-server=name
+ Set the default character set.
+ --character-sets-dir=name
+ Directory where character sets are
+ -r, --chroot=name Chroot mysqld daemon during startup.
+ --collation-server=name
+ Set the default collation.
+ --completion-type=name
+ The transaction completion type, one of NO_CHAIN, CHAIN,
+ RELEASE
+ --concurrent-insert[=name]
+ Use concurrent insert with MyISAM. Possible values are
+ NEVER, AUTO, ALWAYS
+ --connect-timeout=# The number of seconds the mysqld server is waiting for a
+ connect packet before responding with 'Bad handshake'
+ --console Write error output on screen; Don't remove the console
+ window on windows.
+ --core-file Write core on errors.
+ -h, --datadir=name Path to the database root directory
+ --date-format=name The DATE format (ignored)
+ --datetime-format=name
+ The DATETIME format (ignored)
+ -C, --default-character-set=name
+ Set the default character set (deprecated option, use
+ --character-set-server instead).
+ --default-collation=name
+ Set the default collation (deprecated option, use
+ --collation-server instead).
+ --default-storage-engine=name
+ The default storage engine for new tables
+ --default-time-zone=name
+ Set the default time zone.
+ --default-week-format=#
+ The default week format used by WEEK() functions
+ --delay-key-write[=name]
+ Type of DELAY_KEY_WRITE
+ --delay-key-write-for-all-tables
+ Don't flush key buffers between writes for any MyISAM
+ table (Deprecated option, use --delay-key-write=all
+ instead).
+ --delayed-insert-limit=#
+ After inserting delayed_insert_limit rows, the INSERT
+ DELAYED handler will check if there are any SELECT
+ statements pending. If so, it allows these to execute
+ before continuing
+ --delayed-insert-timeout=#
+ How long a INSERT DELAYED thread should wait for INSERT
+ statements before terminating
+ --delayed-queue-size=#
+ What size queue (in rows) should be allocated for
+ handling INSERT DELAYED. If the queue becomes full, any
+ client that does INSERT DELAYED will wait until there is
+ room in the queue again
+ --disconnect-slave-event-count=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --div-precision-increment=#
+ Precision of the result of '/' operator will be increased
+ on that value
+ --enable-locking Deprecated option, use --external-locking instead.
+ --engine-condition-pushdown
+ Push supported query conditions to the storage engine.
+ Deprecated, use --optimizer-switch instead.
+ (Defaults to on; use --skip-engine-condition-pushdown to disable.)
+ --event-scheduler[=name]
+ Enable the event scheduler. Possible values are ON, OFF,
+ and DISABLED (keep the event scheduler completely
+ deactivated, it cannot be activated run-time)
+ -T, --exit-info[=#] Used for debugging; Use at your own risk!
+ --expire-logs-days=#
+ If non-zero, binary logs will be purged after
+ expire_logs_days days; possible purges happen at startup
+ and at binary log rotation
+ --external-locking Use system (external) locking (disabled by default).
+ With this option enabled you can run myisamchk to test
+ (not repair) tables while the MySQL server is running.
+ Disable with --skip-external-locking.
+ --federated[=name] Enable or disable FEDERATED plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --flush Flush MyISAM tables to disk between SQL commands
+ --flush-time=# A dedicated thread is created to flush all tables at the
+ given interval
+ --ft-boolean-syntax=name
+ List of operators for MATCH ... AGAINST ( ... IN BOOLEAN
+ MODE)
+ --ft-max-word-len=# The maximum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-min-word-len=# The minimum length of the word to be included in a
+ FULLTEXT index. Note: FULLTEXT indexes must be rebuilt
+ after changing this variable
+ --ft-query-expansion-limit=#
+ Number of best matches to use for query expansion
+ --ft-stopword-file=name
+ Use stopwords from this file instead of built-in list
+ --gdb Set up signals usable for debugging
+ --general-log Log connections and queries to a table or log file.
+ Defaults logging to a file hostname.log or a table
+ mysql.general_logif --log-output=TABLE is used
+ --general-log-file=name
+ Log connections and queries to given file
+ --group-concat-max-len=#
+ The maximum length of the result of function
+ GROUP_CONCAT()
+ -?, --help Display this help and exit.
+ --ignore-builtin-innodb
+ Disable initialization of builtin InnoDB plugin
+ --init-connect=name Command(s) that are executed for each new connection
+ --init-file=name Read SQL commands from this file at startup
+ --init-rpl-role=name
+ Set the replication role.
+ --init-slave=name Command(s) that are executed by a slave server each time
+ the SQL thread starts
+ --interactive-timeout=#
+ The number of seconds the server waits for activity on an
+ interactive connection before closing it
+ --join-buffer-size=#
+ The size of the buffer that is used for full joins
+ --keep-files-on-create
+ Don't overwrite stale .MYD and .MYI even if no directory
+ is specified
+ --key-buffer-size=# The size of the buffer used for index blocks for MyISAM
+ tables. Increase this to get better index handling (for
+ all reads and multiple writes) to as much as you can
+ afford
+ --key-cache-age-threshold=#
+ This characterizes the number of hits a hot block has to
+ be untouched until it is considered aged enough to be
+ downgraded to a warm block. This specifies the percentage
+ ratio of that number of hits to the total number of
+ blocks in key cache
+ --key-cache-block-size=#
+ The default size of key cache blocks
+ --key-cache-division-limit=#
+ The minimum percentage of warm blocks in key cache
+ -L, --language=name Client error messages in given language. May be given as
+ a full path. Deprecated. Use --lc-messages-dir instead.
+ --lc-messages=name Set the language used for the error messages.
+ -L, --lc-messages-dir=name
+ Directory where error messages are
+ --lc-time-names=name
+ Set the language used for the month names and the days of
+ the week.
+ --local-infile Enable LOAD DATA LOCAL INFILE
+ (Defaults to on; use --skip-local-infile to disable.)
+ -l, --log[=name] Log connections and queries to file (deprecated option,
+ use --general-log/--general-log-file instead).
+ --log-bin[=name] Log update queries in binary format. Optional (but
+ strongly recommended to avoid replication problems if
+ server's hostname changes) argument should be the chosen
+ location for the binary log files.
+ --log-bin-index=name
+ File that holds the names for last binary log files.
+ --log-bin-trust-function-creators
+ If set to FALSE (the default), then when --log-bin is
+ used, creation of a stored function (or trigger) is
+ allowed only to users having the SUPER privilege and only
+ if this stored function (trigger) may not break binary
+ logging. Note that if ALL connections to this server
+ ALWAYS use row-based binary logging, the security issues
+ do not exist and the binary logging cannot break, so you
+ can safely set this to TRUE
+ --log-error[=name] Error log file
+ --log-isam[=name] Log all MyISAM changes to file.
+ -0, --log-long-format
+ Log some extra information to update log. Please note
+ that this option is deprecated; see --log-short-format
+ option.
+ --log-output=name Syntax: log-output=value[,value...], where "value" could
+ be TABLE, FILE or NONE
+ --log-queries-not-using-indexes
+ Log queries that are executed without benefit of any
+ index to the slow log if it is open
+ --log-short-format Don't log extra information to update and slow-query
+ logs.
+ --log-slave-updates Tells the slave to log the updates from the slave thread
+ to the binary log. You will need to turn it on if you
+ plan to daisy-chain the slaves
+ --log-slow-admin-statements
+ Log slow OPTIMIZE, ANALYZE, ALTER and other
+ administrative statements to the slow log if it is open.
+ --log-slow-queries[=name]
+ Log slow queries to a table or log file. Defaults logging
+ to table mysql.slow_log or hostname-slow.log if
+ --log-output=file is used. Must be enabled to activate
+ other slow log options. Deprecated option, use
+ --slow-query-log/--slow-query-log-file instead.
+ --log-slow-slave-statements
+ Log slow statements executed by slave thread to the slow
+ log if it is open.
+ --log-tc=name Path to transaction coordinator log (used for
+ transactions that affect more than one storage engine,
+ when binary log is disabled)
+ --log-tc-size=# Size of transaction coordinator log.
+ --log-update[=name] The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option justs turns on
+ --log-bin instead.
+ -W, --log-warnings[=#]
+ Log some not critical warnings to the log file
+ --long-query-time=# Log all queries that have taken more than long_query_time
+ seconds to execute to file. The argument will be treated
+ as a decimal value with microsecond precision
+ --low-priority-updates
+ INSERT/DELETE/UPDATE has lower priority than selects
+ --lower-case-table-names[=#]
+ If set to 1 table names are stored in lowercase on disk
+ and table names will be case-insensitive. Should be set
+ to 2 if you are using a case insensitive file system
+ --master-info-file=name
+ The location and name of the file that remembers the
+ master and where the I/O replication thread is in the
+ master's binlogs.
+ --master-retry-count=#
+ The number of tries the slave will make to connect to the
+ master before giving up.
+ --max-allowed-packet=#
+ Max packet length to send to or receive from the server
+ --max-binlog-cache-size=#
+ Can be used to restrict the total size used to cache a
+ multi-transaction query
+ --max-binlog-dump-events=#
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --max-binlog-size=# Binary log will be rotated automatically when the size
+ exceeds this value. Will also apply to relay logs if
+ max_relay_log_size is 0
+ --max-connect-errors=#
+ If there is more than this number of interrupted
+ connections from a host this host will be blocked from
+ further connections
+ --max-connections=# The number of simultaneous clients allowed
+ --max-delayed-threads=#
+ Don't start more than this number of threads to handle
+ INSERT DELAYED statements. If set to zero INSERT DELAYED
+ will be not used
+ --max-error-count=# Max number of errors/warnings to store for a statement
+ --max-heap-table-size=#
+ Don't allow creation of heap tables bigger than this
+ --max-join-size=# Joins that are probably going to read more than
+ max_join_size records return an error
+ --max-length-for-sort-data=#
+ Max number of bytes in sorted records
+ --max-prepared-stmt-count=#
+ Maximum number of prepared statements in the server
+ --max-relay-log-size=#
+ If non-zero: relay log will be rotated automatically when
+ the size exceeds this value; if zero: when the size
+ exceeds max_binlog_size
+ --max-seeks-for-key=#
+ Limit assumed max number of seeks when looking up rows
+ based on a key
+ --max-sort-length=# The number of bytes to use when sorting BLOB or TEXT
+ values (only the first max_sort_length bytes of each
+ value are used; the rest are ignored)
+ --max-sp-recursion-depth[=#]
+ Maximum stored procedure recursion depth
+ --max-tmp-tables=# Maximum number of temporary tables a client can keep open
+ at a time
+ --max-user-connections=#
+ The maximum number of active connections for a single
+ user (0 = no limit)
+ --max-write-lock-count=#
+ After this many write locks, allow some read locks to run
+ in between
+ --memlock Lock mysqld in memory.
+ --min-examined-row-limit=#
+ Don't write queries to slow log that examine fewer rows
+ than that
+ --multi-range-count=#
+ Number of key ranges to request at once
+ --myisam-block-size=#
+ Block size to be used for MyISAM index pages
+ --myisam-data-pointer-size=#
+ Default pointer size to be used for MyISAM tables
+ --myisam-max-sort-file-size=#
+ Don't use the fast sort index method to created index if
+ the temporary file would get bigger than this
+ --myisam-mmap-size=#
+ Restricts the total memory used for memory mapping of
+ MySQL tables
+ --myisam-recover-options[=name]
+ Syntax: myisam-recover-options[=option[,option...]],
+ where option can be DEFAULT, BACKUP, FORCE, QUICK, or OFF
+ --myisam-repair-threads=#
+ If larger than 1, when repairing a MyISAM table all
+ indexes will be created in parallel, with one thread per
+ index. The value of 1 disables parallel repair
+ --myisam-sort-buffer-size=#
+ The buffer that is allocated when sorting the index when
+ doing a REPAIR or when creating indexes with CREATE INDEX
+ or ALTER TABLE
+ --myisam-stats-method=name
+ Specifies how MyISAM index statistics collection code
+ should treat NULLs. Possible values of name are
+ NULLS_UNEQUAL (default behavior for 4.1 and later),
+ NULLS_EQUAL (emulate 4.0 behavior), and NULLS_IGNORED
+ --myisam-use-mmap Use memory mapping for reading and writing MyISAM tables
+ --named-pipe Enable the named pipe (NT)
+ --net-buffer-length=#
+ Buffer length for TCP/IP and socket communication
+ --net-read-timeout=#
+ Number of seconds to wait for more data from a connection
+ before aborting the read
+ --net-retry-count=# If a read on a communication port is interrupted, retry
+ this many times before giving up
+ --net-write-timeout=#
+ Number of seconds to wait for a block to be written to a
+ connection before aborting the write
+ -n, --new Use very new possible "unsafe" functions
+ --old Use compatible behavior
+ --old-alter-table Use old, non-optimized alter table
+ --old-passwords Use old password encryption method (needed for 4.0 and
+ older clients)
+ --old-style-user-limits
+ Enable old-style user limits (before 5.0.3 user resources
+ were counted per each user+host vs. per account)
+ --one-thread (deprecated): Only use one thread (for debugging under
+ Linux). Use thread-handling=no-threads instead
+ --open-files-limit=#
+ If this is not 0, then mysqld will use this value to
+ reserve file descriptors to use with setrlimit(). If this
+ value is 0 then mysqld will reserve max_connections*5 or
+ max_connections + table_cache*2 (whichever is larger)
+ number of file descriptors
+ --optimizer-prune-level=#
+ Controls the heuristic(s) applied during query
+ optimization to prune less-promising partial plans from
+ the optimizer search space. Meaning: 0 - do not apply any
+ heuristic, thus perform exhaustive search; 1 - prune
+ plans based on number of retrieved rows
+ --optimizer-search-depth=#
+ Maximum depth of search performed by the query optimizer.
+ Values larger than the number of relations in a query
+ result in better query plans, but take longer to compile
+ a query. Values smaller than the number of tables in a
+ relation result in faster optimization, but may produce
+ very bad query plans. If set to 0, the system will
+ automatically pick a reasonable value; if set to 63, the
+ optimizer will switch to the original find_best
+ search(used for testing/comparison)
+ --optimizer-switch=name
+ optimizer_switch=option=val[,option=val...], where option
+ is one of {index_merge, index_merge_union,
+ index_merge_sort_union, index_merge_intersection,
+ engine_condition_pushdown} and val is one of {on, off,
+ default}
+ --partition[=name] Enable or disable partition plugin. Possible values are
+ ON, OFF, FORCE (don't start if the plugin fails to load).
+ --performance-schema
+ Enable the performance schema.
+ --performance-schema-events-waits-history-long-size=#
+ Number of rows in EVENTS_WAITS_HISTORY_LONG.
+ --performance-schema-events-waits-history-size=#
+ Number of rows per thread in EVENTS_WAITS_HISTORY.
+ --performance-schema-max-cond-classes=#
+ Maximum number of condition instruments.
+ --performance-schema-max-cond-instances=#
+ Maximum number of instrumented condition objects.
+ --performance-schema-max-file-classes=#
+ Maximum number of file instruments.
+ --performance-schema-max-file-handles=#
+ Maximum number of opened instrumented files.
+ --performance-schema-max-file-instances=#
+ Maximum number of instrumented files.
+ --performance-schema-max-mutex-classes=#
+ Maximum number of mutex instruments.
+ --performance-schema-max-mutex-instances=#
+ Maximum number of instrumented MUTEX objects.
+ --performance-schema-max-rwlock-classes=#
+ Maximum number of rwlock instruments.
+ --performance-schema-max-rwlock-instances=#
+ Maximum number of instrumented RWLOCK objects.
+ --performance-schema-max-table-handles=#
+ Maximum number of opened instrumented tables.
+ --performance-schema-max-table-instances=#
+ Maximum number of instrumented tables.
+ --performance-schema-max-thread-classes=#
+ Maximum number of thread instruments.
+ --performance-schema-max-thread-instances=#
+ Maximum number of instrumented threads.
+ --pid-file=name Pid file used by safe_mysqld
+ --plugin-dir=name Directory for plugins
+ --plugin-load=name Optional semicolon-separated list of plugins to load,
+ where each plugin is identified as name=library, where
+ name is the plugin name and library is the plugin library
+ in plugin_dir.
+ -P, --port=# Port number to use for connection or 0 to default to,
+ my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default
+ (3306), whatever comes first
+ --port-open-timeout=#
+ Maximum time in seconds to wait for the port to become
+ free. (Default: no wait)
+ --preload-buffer-size=#
+ The size of the buffer that is allocated when preloading
+ indexes
+ --profiling-history-size=#
+ Limit of query profiling memory
+ --query-alloc-block-size=#
+ Allocation block size for query parsing and execution
+ --query-cache-limit=#
+ Don't cache results that are bigger than this
+ --query-cache-min-res-unit=#
+ The minimum size for blocks allocated by the query cache
+ --query-cache-size=#
+ The memory allocated to store results from old queries
+ --query-cache-type=name
+ OFF = Don't cache or retrieve results. ON = Cache all
+ results except SELECT SQL_NO_CACHE ... queries. DEMAND =
+ Cache only SELECT SQL_CACHE ... queries
+ --query-cache-wlock-invalidate
+ Invalidate queries in query cache on LOCK for write
+ --query-prealloc-size=#
+ Persistent buffer for query parsing and execution
+ --range-alloc-block-size=#
+ Allocation block size for storing ranges during
+ optimization
+ --read-buffer-size=#
+ Each thread that does a sequential scan allocates a
+ buffer of this size for each table it scans. If you do
+ many sequential scans, you may want to increase this
+ value
+ --read-only Make all non-temporary tables read-only, with the
+ exception for replication (slave) threads and users with
+ the SUPER privilege
+ --read-rnd-buffer-size=#
+ When reading rows in sorted order after a sort, the rows
+ are read through this buffer to avoid a disk seeks. If
+ not set, then it's set to the value of record_buffer
+ --record-buffer=# Deprecated; use --read-buffer-size instead.
+ --relay-log=name The location and name to use for relay logs
+ --relay-log-index=name
+ The location and name to use for the file that keeps a
+ list of the last relay logs
+ --relay-log-info-file=name
+ The location and name of the file that remembers where
+ the SQL replication thread is in the relay logs
+ --relay-log-purge if disabled - do not purge relay logs. if enabled - purge
+ them as soon as they are no more needed
+ (Defaults to on; use --skip-relay-log-purge to disable.)
+ --relay-log-recovery
+ Enables automatic relay log recovery right after the
+ database startup, which means that the IO Thread starts
+ re-fetching from the master right after the last
+ transaction processed
+ --relay-log-space-limit=#
+ Maximum space to use for all relay logs
+ --replicate-do-db=name
+ Tells the slave thread to restrict replication to the
+ specified database. To specify more than one database,
+ use the directive multiple times, once for each database.
+ Note that this will only work if you do not use
+ cross-database queries such as UPDATE some_db.some_table
+ SET foo='bar' while having selected a different or no
+ database. If you need cross database updates to work,
+ make sure you have 3.23.28 or later, and use
+ replicate-wild-do-table=db_name.%.
+ --replicate-do-table=name
+ Tells the slave thread to restrict replication to the
+ specified table. To specify more than one table, use the
+ directive multiple times, once for each table. This will
+ work for cross-database updates, in contrast to
+ replicate-do-db.
+ --replicate-ignore-db=name
+ Tells the slave thread to not replicate to the specified
+ database. To specify more than one database to ignore,
+ use the directive multiple times, once for each database.
+ This option will not work if you use cross database
+ updates. If you need cross database updates to work, make
+ sure you have 3.23.28 or later, and use
+ replicate-wild-ignore-table=db_name.%.
+ --replicate-ignore-table=name
+ Tells the slave thread to not replicate to the specified
+ table. To specify more than one table to ignore, use the
+ directive multiple times, once for each table. This will
+ work for cross-datbase updates, in contrast to
+ replicate-ignore-db.
+ --replicate-rewrite-db=name
+ Updates to a database with a different name than the
+ original. Example:
+ replicate-rewrite-db=master_db_name->slave_db_name.
+ --replicate-same-server-id
+ In replication, if set to 1, do not skip events having
+ our server id. Default value is 0 (to break infinite
+ loops in circular replication). Can't be set to 1 if
+ --log-slave-updates is used.
+ --replicate-wild-do-table=name
+ Tells the slave thread to restrict replication to the
+ tables that match the specified wildcard pattern. To
+ specify more than one table, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-do-table=foo%.bar% will replicate only
+ updates to tables in all databases that start with foo
+ and whose table names start with bar.
+ --replicate-wild-ignore-table=name
+ Tells the slave thread to not replicate to the tables
+ that match the given wildcard pattern. To specify more
+ than one table to ignore, use the directive multiple
+ times, once for each table. This will work for
+ cross-database updates. Example:
+ replicate-wild-ignore-table=foo%.bar% will not do updates
+ to tables in databases that start with foo and whose
+ table names start with bar.
+ --report-host=name Hostname or IP of the slave to be reported to the master
+ during slave registration. Will appear in the output of
+ SHOW SLAVE HOSTS. Leave unset if you do not want the
+ slave to register itself with the master. Note that it is
+ not sufficient for the master to simply read the IP of
+ the slave off the socket once the slave connects. Due to
+ NAT and other routing issues, that IP may not be valid
+ for connecting to the slave from the master or other
+ hosts
+ --report-password=name
+ The account password of the slave to be reported to the
+ master during slave registration
+ --report-port=# Port for connecting to slave reported to the master
+ during slave registration. Set it only if the slave is
+ listening on a non-default port or if you have a special
+ tunnel from the master or other clients to the slave. If
+ not sure, leave this option unset
+ --report-user=name The account user name of the slave to be reported to the
+ master during slave registration
+ --rpl-recovery-rank=#
+ Unused, will be removed
+ --safe-mode Skip some optimize stages (for testing).
+ --safe-show-database
+ Deprecated option; use GRANT SHOW DATABASES instead...
+ --safe-user-create Don't allow new user creation by the user who has no
+ write privileges to the mysql.user table.
+ --secure-auth Disallow authentication for accounts that have old
+ (pre-4.1) passwords
+ --secure-file-priv=name
+ Limit LOAD DATA, SELECT ... OUTFILE, and LOAD_FILE() to
+ files within specified directory
+ --server-id=# Uniquely identifies the server instance in the community
+ of replication partners
+ -O, --set-variable=name
+ Change the value of a variable. Please note that this
+ option is deprecated;you can set variables directly with
+ --variable-name=value.
+ --shared-memory Enable the shared memory
+ --shared-memory-base-name=name
+ Base name of shared memory
+ --show-slave-auth-info
+ Show user and password in SHOW SLAVE HOSTS on this master
+ --skip-grant-tables Start without grant tables. This gives all users FULL
+ ACCESS to all tables!
+ --skip-host-cache Don't cache host names.
+ --skip-locking Deprecated option, use --skip-external-locking instead.
+ --skip-name-resolve Don't resolve hostnames. All hostnames are IP's or
+ 'localhost'.
+ --skip-networking Don't allow connection with TCP/IP
+ --skip-new Don't use new, possible wrong routines.
+ --skip-show-database
+ Don't allow 'SHOW DATABASE' commands
+ --skip-slave-start If set, slave is not autostarted.
+ --skip-stack-trace Don't print a stack trace on failure.
+ --skip-symlink Don't allow symlinking of tables. Deprecated option. Use
+ --skip-symbolic-links instead.
+ --skip-thread-priority
+ Don't give threads different priorities. This option is
+ deprecated because it has no effect; the implied behavior
+ is already the default.
+ --slave-compressed-protocol
+ Use compression on master/slave protocol
+ --slave-exec-mode=name
+ Modes for how replication events should be executed.
+ Legal values are STRICT (default) and IDEMPOTENT. In
+ IDEMPOTENT mode, replication will not stop for operations
+ that are idempotent. In STRICT mode, replication will
+ stop on any unexpected difference between the master and
+ the slave
+ --slave-load-tmpdir=name
+ The location where the slave should put its temporary
+ files when replicating a LOAD DATA INFILE command
+ --slave-net-timeout=#
+ Number of seconds to wait for more data from a
+ master/slave connection before aborting the read
+ --slave-skip-errors=name
+ Tells the slave thread to continue replication when a
+ query event returns an error from the provided list
+ --slave-transaction-retries=#
+ Number of times the slave SQL thread will retry a
+ transaction in case it failed with a deadlock or elapsed
+ lock wait timeout, before giving up and stopping
+ --slave-type-conversions=name
+ Set of slave type conversions that are enabled. Legal
+ values are: ALL_LOSSY to enable lossy conversions and
+ ALL_NON_LOSSY to enable non-lossy conversions. If the
+ variable is assigned the empty set, no conversions are
+ allowed and it is expected that the types match exactly.
+ --slow-launch-time=#
+ If creating the thread takes longer than this value (in
+ seconds), the Slow_launch_threads counter will be
+ incremented
+ --slow-query-log Log slow queries to a table or log file. Defaults logging
+ to a file hostname-slow.log or a table mysql.slow_log if
+ --log-output=TABLE is used. Must be enabled to activate
+ other slow log options
+ --slow-query-log-file=name
+ Log slow queries to given log file. Defaults logging to
+ hostname-slow.log. Must be enabled to activate other slow
+ log options
+ --socket=name Socket file to use for connection
+ --sort-buffer-size=#
+ Each thread that needs to do a sort allocates a buffer of
+ this size
+ --sporadic-binlog-dump-fail
+ Option used by mysql-test for debugging and testing of
+ replication.
+ --sql-bin-update-same
+ The update log is deprecated since version 5.0, is
+ replaced by the binary log and this option does nothing
+ anymore.
+ --sql-mode=name Syntax: sql-mode=mode[,mode[,mode...]]. See the manual
+ for the complete list of valid sql modes
+ --standalone Dummy option to start as a standalone program (NT).
+ -s, --symbolic-links
+ Enable symbolic link support.
+ --sync-binlog=# Synchronously flush binary log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-frm Sync .frm files to disk on creation
+ (Defaults to on; use --skip-sync-frm to disable.)
+ --sync-master-info=#
+ Synchronously flush master info to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log=# Synchronously flush relay log to disk after every #th
+ event. Use 0 (default) to disable synchronous flushing
+ --sync-relay-log-info=#
+ Synchronously flush relay log info to disk after every
+ #th transaction. Use 0 (default) to disable synchronous
+ flushing
+ --sysdate-is-now Non-default option to alias SYSDATE() to NOW() to make it
+ safe-replicable. Since 5.0, SYSDATE() returns a `dynamic'
+ value different for different invocations, even within
+ the same statement.
+ --table-cache=# Deprecated; use --table-open-cache instead.
+ --table-definition-cache=#
+ The number of cached table definitions
+ --table-lock-wait-timeout=#
+ Timeout in seconds to wait for a table level lock before
+ returning an error. Used only if the connection has
+ active cursors
+ --table-open-cache=#
+ The number of cached open tables
+ --tc-heuristic-recover=name
+ Decision to use in heuristic recover process. Possible
+ values are COMMIT or ROLLBACK.
+ --thread-cache-size=#
+ How many threads we should keep in a cache for reuse
+ --thread-handling=name
+ Define threads usage for handling queries, one of
+ one-thread-per-connection, no-threads
+ --thread-stack=# The stack size for each thread
+ --time-format=name The TIME format (ignored)
+ --timed-mutexes Specify whether to time mutexes (only InnoDB mutexes are
+ currently supported)
+ --tmp-table-size=# If an internal in-memory temporary table exceeds this
+ size, MySQL will automatically convert it to an on-disk
+ MyISAM table
+ -t, --tmpdir=name Path for temporary files. Several paths may be specified,
+ separated by a semicolon (;), in this case they are used
+ in a round-robin fashion
+ --transaction-alloc-block-size=#
+ Allocation block size for transactions to be stored in
+ binary log
+ --transaction-isolation=name
+ Default transaction isolation level.
+ --transaction-prealloc-size=#
+ Persistent buffer for transactions to be stored in binary
+ log
+ --updatable-views-with-limit=name
+ YES = Don't issue an error message (warning only) if a
+ VIEW without presence of a key of the underlying table is
+ used in queries with a LIMIT clause for updating. NO =
+ Prohibit update of a VIEW, which does not contain a key
+ of the underlying table and the query uses a LIMIT clause
+ (usually get from GUI tools)
+ -s, --use-symbolic-links
+ Enable symbolic link support. Deprecated option; use
+ --symbolic-links instead.
+ -u, --user=name Run mysqld daemon as user.
+ -v, --verbose Used with --help option for detailed help
+ -V, --version Output version information and exit.
+ --wait-timeout=# The number of seconds the server waits for activity on a
+ connection before closing it
+ -W, --warnings[=#] Deprecated; use --log-warnings instead.
+
+Variables (--variable-name=value)
+and boolean options {FALSE|TRUE} Value (after reading options)
+------------------------------------------------- ------------------------
+abort-slave-event-count 0
+allow-suspicious-udfs FALSE
+archive ON
+auto-increment-increment 1
+auto-increment-offset 1
+automatic-sp-privileges TRUE
+back-log 50
+big-tables FALSE
+bind-address (No default value)
+binlog-cache-size 32768
+binlog-format STATEMENT
+binlog-row-event-max-size 1024
+blackhole ON
+bulk-insert-buffer-size 8388608
+character-set-client-handshake TRUE
+character-set-filesystem binary
+character-set-server latin1
+character-sets-dir MYSQL_SHAREDIR/charsets/
+chroot (No default value)
+collation-server latin1_swedish_ci
+completion-type NO_CHAIN
+concurrent-insert AUTO
+connect-timeout 10
+console FALSE
+date-format %Y-%m-%d
+datetime-format %Y-%m-%d %H:%i:%s
+default-character-set latin1
+default-collation latin1_swedish_ci
+default-storage-engine MyISAM
+default-time-zone (No default value)
+default-week-format 0
+delay-key-write ON
+delayed-insert-limit 100
+delayed-insert-timeout 300
+delayed-queue-size 1000
+disconnect-slave-event-count 0
+div-precision-increment 4
+enable-locking FALSE
+engine-condition-pushdown TRUE
+event-scheduler OFF
+expire-logs-days 0
+external-locking FALSE
+federated ON
+flush FALSE
+flush-time 1800
+ft-boolean-syntax + -><()~*:""&|
+ft-max-word-len 84
+ft-min-word-len 4
+ft-query-expansion-limit 20
+ft-stopword-file (No default value)
+gdb FALSE
+general-log FALSE
+group-concat-max-len 1024
+help TRUE
+ignore-builtin-innodb FALSE
+init-connect
+init-file (No default value)
+init-rpl-role MASTER
+init-slave
+interactive-timeout 28800
+join-buffer-size 131072
+keep-files-on-create FALSE
+key-buffer-size 8388608
+key-cache-age-threshold 300
+key-cache-block-size 1024
+key-cache-division-limit 100
+language MYSQL_SHAREDIR/
+lc-messages en_US
+lc-messages-dir MYSQL_SHAREDIR/
+lc-time-names en_US
+local-infile TRUE
+log-bin (No default value)
+log-bin-index (No default value)
+log-bin-trust-function-creators FALSE
+log-error
+log-isam myisam.log
+log-output FILE
+log-queries-not-using-indexes FALSE
+log-short-format FALSE
+log-slave-updates FALSE
+log-slow-admin-statements FALSE
+log-slow-slave-statements FALSE
+log-tc tc.log
+log-tc-size 24576
+log-update (No default value)
+log-warnings 1
+long-query-time 10
+low-priority-updates FALSE
+lower-case-table-names 1
+master-info-file master.info
+master-retry-count 86400
+max-allowed-packet 1048576
+max-binlog-cache-size 18446744073709547520
+max-binlog-dump-events 0
+max-binlog-size 1073741824
+max-connect-errors 10
+max-connections 151
+max-delayed-threads 20
+max-error-count 64
+max-heap-table-size 16777216
+max-join-size 18446744073709551615
+max-length-for-sort-data 1024
+max-prepared-stmt-count 16382
+max-relay-log-size 0
+max-seeks-for-key 18446744073709551615
+max-sort-length 1024
+max-sp-recursion-depth 0
+max-tmp-tables 32
+max-user-connections 0
+max-write-lock-count 18446744073709551615
+memlock FALSE
+min-examined-row-limit 0
+multi-range-count 256
+myisam-block-size 1024
+myisam-data-pointer-size 6
+myisam-max-sort-file-size 9223372036853727232
+myisam-mmap-size 18446744073709551615
+myisam-recover-options OFF
+myisam-repair-threads 1
+myisam-sort-buffer-size 8388608
+myisam-stats-method nulls_unequal
+myisam-use-mmap FALSE
+named-pipe FALSE
+net-buffer-length 16384
+net-read-timeout 30
+net-retry-count 10
+net-write-timeout 60
+new FALSE
+old FALSE
+old-alter-table FALSE
+old-passwords FALSE
+old-style-user-limits FALSE
+optimizer-prune-level 1
+optimizer-search-depth 62
+optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
+partition ON
+performance-schema FALSE
+performance-schema-events-waits-history-long-size 10000
+performance-schema-events-waits-history-size 10
+performance-schema-max-cond-classes 80
+performance-schema-max-cond-instances 1000
+performance-schema-max-file-classes 50
+performance-schema-max-file-handles 32768
+performance-schema-max-file-instances 10000
+performance-schema-max-mutex-classes 200
+performance-schema-max-mutex-instances 1000
+performance-schema-max-rwlock-classes 20
+performance-schema-max-rwlock-instances 1000
+performance-schema-max-table-handles 100000
+performance-schema-max-table-instances 50000
+performance-schema-max-thread-classes 50
+performance-schema-max-thread-instances 1000
+plugin-dir MYSQL_LIBDIR/plugin
+plugin-load (No default value)
+port 3306
+port-open-timeout 0
+preload-buffer-size 32768
+profiling-history-size 15
+query-alloc-block-size 8192
+query-cache-limit 1048576
+query-cache-min-res-unit 4096
+query-cache-size 0
+query-cache-type ON
+query-cache-wlock-invalidate FALSE
+query-prealloc-size 8192
+range-alloc-block-size 4096
+read-buffer-size 131072
+read-only FALSE
+read-rnd-buffer-size 262144
+record-buffer 131072
+relay-log (No default value)
+relay-log-index (No default value)
+relay-log-info-file relay-log.info
+relay-log-purge TRUE
+relay-log-recovery FALSE
+relay-log-space-limit 0
+replicate-same-server-id FALSE
+report-host (No default value)
+report-password (No default value)
+report-port 3306
+report-user (No default value)
+rpl-recovery-rank 0
+safe-user-create FALSE
+secure-auth FALSE
+secure-file-priv (No default value)
+server-id 0
+shared-memory FALSE
+shared-memory-base-name MYSQL
+show-slave-auth-info FALSE
+skip-grant-tables TRUE
+skip-networking FALSE
+skip-show-database FALSE
+skip-slave-start FALSE
+slave-compressed-protocol FALSE
+slave-exec-mode STRICT
+slave-net-timeout 3600
+slave-skip-errors (No default value)
+slave-transaction-retries 10
+slave-type-conversions
+slow-launch-time 2
+slow-query-log FALSE
+socket MySQL
+sort-buffer-size 2097152
+sporadic-binlog-dump-fail FALSE
+sql-mode
+symbolic-links FALSE
+sync-binlog 0
+sync-frm TRUE
+sync-master-info 0
+sync-relay-log 0
+sync-relay-log-info 0
+sysdate-is-now FALSE
+table-cache 400
+table-definition-cache 400
+table-lock-wait-timeout 50
+table-open-cache 400
+tc-heuristic-recover COMMIT
+thread-cache-size 0
+thread-handling one-thread-per-connection
+thread-stack 262144
+time-format %H:%i:%s
+timed-mutexes FALSE
+tmp-table-size 16777216
+transaction-alloc-block-size 8192
+transaction-isolation REPEATABLE-READ
+transaction-prealloc-size 4096
+updatable-views-with-limit YES
+use-symbolic-links FALSE
+verbose TRUE
+wait-timeout 28800
+warnings 1
+
+To see what values a running MySQL server is using, type
+'mysqladmin variables' instead of 'mysqld --verbose --help'.
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 8162e1aca05..4724a111837 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"
@@ -55,7 +55,7 @@ CREATE TABLE `t1` (
`a` double DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-INSERT INTO `t1` VALUES (RES);
+INSERT INTO `t1` VALUES (-1.7976931348623157e308);
DROP TABLE t1;
#
# Bug#3361 mysqldump quotes DECIMAL values inconsistently
@@ -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/mysqlshow.result b/mysql-test/r/mysqlshow.result
index 42081c309d0..4293465df67 100644
--- a/mysql-test/r/mysqlshow.result
+++ b/mysql-test/r/mysqlshow.result
@@ -90,6 +90,7 @@ Database: information_schema
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| KEY_COLUMN_USAGE |
+| PARAMETERS |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
@@ -102,11 +103,19 @@ Database: information_schema
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
+| TABLESPACES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+| INNODB_CMP_RESET |
+| INNODB_TRX |
+| INNODB_CMPMEM_RESET |
+| INNODB_LOCK_WAITS |
+| INNODB_CMPMEM |
+| INNODB_CMP |
+| INNODB_LOCKS |
+---------------------------------------+
Database: INFORMATION_SCHEMA
+---------------------------------------+
@@ -123,6 +132,7 @@ Database: INFORMATION_SCHEMA
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| KEY_COLUMN_USAGE |
+| PARAMETERS |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
@@ -135,11 +145,19 @@ Database: INFORMATION_SCHEMA
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
+| TABLESPACES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+| INNODB_CMP_RESET |
+| INNODB_TRX |
+| INNODB_CMPMEM_RESET |
+| INNODB_LOCK_WAITS |
+| INNODB_CMPMEM |
+| INNODB_CMP |
+| INNODB_LOCKS |
+---------------------------------------+
Wildcard: inf_rmation_schema
+--------------------+
diff --git a/mysql-test/r/not_partition.result b/mysql-test/r/not_partition.result
index f516f8634ce..fc3e0d64b5e 100644
--- a/mysql-test/r/not_partition.result
+++ b/mysql-test/r/not_partition.result
@@ -1,47 +1,47 @@
DROP TABLE IF EXISTS t1;
FLUSH TABLES;
SELECT * FROM t1;
-ERROR 42000: Unknown table engine 'partition'
+ERROR 42000: Unknown storage engine 'partition'
TRUNCATE TABLE t1;
-ERROR 42000: Unknown table engine 'partition'
+ERROR 42000: Unknown storage engine 'partition'
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 analyze Error Unknown table engine 'partition'
+test.t1 analyze Error Unknown storage engine 'partition'
test.t1 analyze error Corrupt
CHECK TABLE t1;
Table Op Msg_type Msg_text
-test.t1 check Error Unknown table engine 'partition'
+test.t1 check Error Unknown storage engine 'partition'
test.t1 check error Corrupt
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
-test.t1 optimize Error Unknown table engine 'partition'
+test.t1 optimize Error Unknown storage engine 'partition'
test.t1 optimize error Corrupt
REPAIR TABLE t1;
Table Op Msg_type Msg_text
-test.t1 repair Error Unknown table engine 'partition'
+test.t1 repair Error Unknown storage engine 'partition'
test.t1 repair error Corrupt
ALTER TABLE t1 REPAIR PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 repair Error Unknown table engine 'partition'
+test.t1 repair Error Unknown storage engine 'partition'
test.t1 repair error Corrupt
ALTER TABLE t1 CHECK PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 check Error Unknown table engine 'partition'
+test.t1 check Error Unknown storage engine 'partition'
test.t1 check error Corrupt
ALTER TABLE t1 OPTIMIZE PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 optimize Error Unknown table engine 'partition'
+test.t1 optimize Error Unknown storage engine 'partition'
test.t1 optimize error Corrupt
ALTER TABLE t1 ANALYZE PARTITION ALL;
Table Op Msg_type Msg_text
-test.t1 analyze Error Unknown table engine 'partition'
+test.t1 analyze Error Unknown storage engine 'partition'
test.t1 analyze error Corrupt
ALTER TABLE t1 REBUILD PARTITION ALL;
-ERROR 42000: Unknown table engine 'partition'
+ERROR 42000: Unknown storage engine 'partition'
ALTER TABLE t1 ENGINE Memory;
-ERROR 42000: Unknown table engine 'partition'
+ERROR 42000: Unknown storage engine 'partition'
ALTER TABLE t1 ADD (new INT);
-ERROR 42000: Unknown table engine 'partition'
+ERROR 42000: Unknown storage engine 'partition'
DROP TABLE t1;
CREATE TABLE t1 (
firstname VARCHAR(25) NOT NULL,
@@ -52,9 +52,9 @@ joined DATE NOT NULL
)
PARTITION BY KEY(joined)
PARTITIONS 6;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (
@@ -71,7 +71,7 @@ PARTITION p2 VALUES LESS THAN (1980),
PARTITION p3 VALUES LESS THAN (1990),
PARTITION p4 VALUES LESS THAN MAXVALUE
);
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (id INT, purchased DATE)
@@ -82,7 +82,7 @@ PARTITION p0 VALUES LESS THAN (1990),
PARTITION p1 VALUES LESS THAN (2000),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
-ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-partition' to have it working
+ERROR HY000: The 'partitioning' feature is disabled; you need MySQL built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
create table t1 (a varchar(10) charset latin1 collate latin1_bin);
diff --git a/mysql-test/r/odbc.result b/mysql-test/r/odbc.result
index 5629d3dab33..3dbac12ca7c 100644
--- a/mysql-test/r/odbc.result
+++ b/mysql-test/r/odbc.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+set @@session.sql_auto_is_null=1;
select {fn length("hello")}, { date "1997-10-20" };
{fn length("hello")} 1997-10-20
5 1997-10-20
@@ -7,9 +8,9 @@ insert into t1 SET A=NULL,B=1;
insert into t1 SET a=null,b=2;
select * from t1 where a is null and b=2;
a b
-2 2
select * from t1 where a is null;
a b
+2 2
explain select * from t1 where b is null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
@@ -25,3 +26,4 @@ SELECT sql_no_cache a, last_insert_id() FROM t1;
a last_insert_id()
1 1
DROP TABLE t1;
+set @@session.sql_auto_is_null=default;
diff --git a/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result b/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result
new file mode 100644
index 00000000000..a8313ec246c
--- /dev/null
+++ b/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result
@@ -0,0 +1,5 @@
+select @@session.engine_condition_pushdown,
+@@global.engine_condition_pushdown,
+@@session.optimizer_switch, @@global.optimizer_switch;
+@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
+1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on
diff --git a/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result b/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result
new file mode 100644
index 00000000000..d7e84c57f42
--- /dev/null
+++ b/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result
@@ -0,0 +1,5 @@
+select @@session.engine_condition_pushdown,
+@@global.engine_condition_pushdown,
+@@session.optimizer_switch, @@global.optimizer_switch;
+@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch
+0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off
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/parser.result b/mysql-test/r/parser.result
index 7e703de0876..467bb7c5cb8 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -522,7 +522,7 @@ select conv(255 AS p1, 10 AS p2, 16 AS p3);
ERROR 42000: Incorrect parameters in the call to native function 'conv'
select atan(10);
atan(10)
-1.47112767430373
+1.4711276743037347
select atan(10 AS p1);
ERROR 42000: Incorrect parameters in the call to native function 'atan'
select atan(10 p1);
@@ -533,7 +533,7 @@ select atan(10 "p1");
ERROR 42000: Incorrect parameters in the call to native function 'atan'
select atan(10, 20);
atan(10, 20)
-0.463647609000806
+0.4636476090008061
select atan(10 AS p1, 20);
ERROR 42000: Incorrect parameters in the call to native function 'atan'
select atan(10 p1, 20);
diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result
index 08357795046..b72cc607fe2 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -94,6 +94,42 @@ INSERT INTO t1 VALUES (NULL);
SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
pk
DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+ENGINE=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown storage engine 'NonExistentEngine'
+Warning 1266 Using storage engine MyISAM for table 't1'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+ENGINE=NonExistentEngine
+PARTITION BY HASH (a);
+Warnings:
+Warning 1286 Unknown storage engine 'NonExistentEngine'
+Warning 1266 Using storage engine MyISAM for table 't1'
+DROP TABLE t1;
+CREATE TABLE t1 (a INT)
+ENGINE=Memory;
+ALTER TABLE t1 ENGINE=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown storage engine 'NonExistentEngine'
+ALTER TABLE t1
+PARTITION BY HASH (a)
+(PARTITION p0 ENGINE=Memory,
+PARTITION p1 ENGINE=NonExistentEngine);
+Warnings:
+Warning 1286 Unknown storage engine 'NonExistentEngine'
+ALTER TABLE t1 ENGINE=NonExistentEngine;
+Warnings:
+Warning 1286 Unknown storage engine 'NonExistentEngine'
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MEMORY DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY HASH (a)
+(PARTITION p0 ENGINE = MEMORY,
+ PARTITION p1 ENGINE = MEMORY) */
+DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL, KEY(a))
PARTITION BY RANGE(a)
(PARTITION p1 VALUES LESS THAN (200), PARTITION pmax VALUES LESS THAN MAXVALUE);
@@ -433,14 +469,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 +1288,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 +1468,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),
@@ -2069,23 +2102,4 @@ COUNT(*)
0
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
-#
-# BUG#45816 - assertion failure with index containing double
-# column on partitioned table
-#
-CREATE TABLE t1 (
-a INT DEFAULT NULL,
-b DOUBLE DEFAULT NULL,
-c INT DEFAULT NULL,
-KEY idx2(b,a)
-) PARTITION BY HASH(c) PARTITIONS 3;
-INSERT INTO t1 VALUES (6,8,9);
-INSERT INTO t1 VALUES (6,8,10);
-SELECT 1 FROM t1 JOIN t1 AS t2 USING (a) FOR UPDATE;
-1
-1
-1
-1
-1
-DROP TABLE t1;
End of 5.1 tests
diff --git a/mysql-test/r/partition_archive.result b/mysql-test/r/partition_archive.result
index de64b09e042..186a7930251 100644
--- a/mysql-test/r/partition_archive.result
+++ b/mysql-test/r/partition_archive.result
@@ -1,3 +1,25 @@
+CREATE TABLE t1 (f1 DATE NOT NULL)
+ENGINE = ARCHIVE PARTITION BY RANGE (TO_DAYS(f1))
+(partition p1 values less than (733751),
+partition p2 values less than MAXVALUE);
+INSERT INTO t1 VALUES(CURRENT_DATE);
+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+DATA_LENGTH INDEX_LENGTH
+190 0
+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+DATA_LENGTH INDEX_LENGTH
+190 0
+DROP TABLE t1;
+CREATE TABLE t1 (f1 DATE NOT NULL)
+ENGINE = ARCHIVE;
+INSERT INTO t1 VALUES(CURRENT_DATE);
+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+DATA_LENGTH INDEX_LENGTH
+8658 0
+SELECT DATA_LENGTH, INDEX_LENGTH FROM information_schema.TABLES WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
+DATA_LENGTH INDEX_LENGTH
+8658 0
+DROP TABLE t1;
drop database if exists db99;
drop table if exists t1;
create database db99;
diff --git a/mysql-test/r/partition_column.result b/mysql-test/r/partition_column.result
new file mode 100644
index 00000000000..ddc48b635cf
--- /dev/null
+++ b/mysql-test/r/partition_column.result
@@ -0,0 +1,602 @@
+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(5) character set ucs2 collate ucs2_bin)
+partition by range columns (a)
+(partition p0 values less than (0x0041));
+insert into t1 values (0x00410000);
+select hex(a) from t1 where a like 'A_';
+hex(a)
+00410000
+explain partitions select hex(a) from t1 where a like 'A_';
+id select_type table partitions type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 p0 system NULL NULL NULL NULL 1
+alter table t1 remove partitioning;
+select hex(a) from t1 where a like 'A_';
+hex(a)
+00410000
+create index a on t1 (a);
+select hex(a) from t1 where a like 'A_';
+hex(a)
+00410000
+insert into t1 values ('A_');
+select hex(a) from t1;
+hex(a)
+00410000
+0041005F
+drop table t1;
+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
+/*!50500 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
+/*!50500 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
+/*!50500 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
+/*!50500 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
+/*!50500 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
+/*!50500 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
+/*!50500 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
+/*!50500 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 b692203823d..0a8b7e1b424 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 f2f6ef138ff..186082c435f 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))
@@ -25,13 +60,7 @@ SET @old_tx_isolation := @@session.tx_isolation;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET autocommit = 0;
UPDATE t1 SET DATA = data*2 WHERE id = 3;
-SHOW ENGINE InnoDB STATUS;
-Type Name Status
-InnoDB 2 lock struct(s) 1 row lock(s)
UPDATE t1 SET data = data*2 WHERE data = 2;
-SHOW ENGINE InnoDB STATUS;
-Type Name Status
-InnoDB 6 lock struct(s) 2 row lock(s)
SET @@session.tx_isolation = @old_tx_isolation;
DROP TABLE t1;
# Bug#37721, test of ORDER BY on PK and WHERE on INDEX
@@ -167,7 +196,7 @@ create table t1 (a int)
engine = x
partition by key (a);
Warnings:
-Warning 1286 Unknown table engine 'x'
+Warning 1286 Unknown storage engine 'x'
Warning 1266 Using storage engine MyISAM for table 't1'
show create table t1;
Table Create Table
@@ -181,7 +210,8 @@ engine = innodb
partition by list (a)
(partition p0 values in (0));
alter table t1 engine = x;
-ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
+Warnings:
+Warning 1286 Unknown storage engine 'x'
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/partition_innodb_builtin.result b/mysql-test/r/partition_innodb_builtin.result
deleted file mode 100644
index 384ce0790a4..00000000000
--- a/mysql-test/r/partition_innodb_builtin.result
+++ /dev/null
@@ -1,39 +0,0 @@
-SET NAMES utf8;
-CREATE TABLE `t``\""e` (a INT, PRIMARY KEY (a))
-ENGINE=InnoDB
-PARTITION BY RANGE (a)
-SUBPARTITION BY HASH (a)
-(PARTITION `p0``\""e` VALUES LESS THAN (100)
-(SUBPARTITION `sp0``\""e`,
-SUBPARTITION `sp1``\""e`),
-PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
-(SUBPARTITION `sp2``\""e`,
-SUBPARTITION `sp3``\""e`));
-INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
-START TRANSACTION;
-# con1
-SET NAMES utf8;
-START TRANSACTION;
-# default connection
-UPDATE `t``\""e` SET a = 16 WHERE a = 0;
-# con1
-UPDATE `t``\""e` SET a = 8 WHERE a = 22;
-UPDATE `t``\""e` SET a = 12 WHERE a = 0;
-# default connection
-UPDATE `t``\""e` SET a = 4 WHERE a = 22;
-ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-# First table reported in 'SHOW ENGINE InnoDB STATUS'
-SHOW ENGINE InnoDB STATUS;
-Type Name Status
-InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
-set @old_sql_mode = @@sql_mode;
-set sql_mode = 'ANSI_QUOTES';
-SHOW ENGINE InnoDB STATUS;
-Type Name Status
-InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
-set @@sql_mode = @old_sql_mode;
-# con1
-ROLLBACK;
-# default connection
-DROP TABLE `t``\""e`;
-SET NAMES DEFAULT;
diff --git a/mysql-test/r/partition_innodb_stmt.result b/mysql-test/r/partition_innodb_stmt.result
index 2735b0d2193..67c33cf7732 100644
--- a/mysql-test/r/partition_innodb_stmt.result
+++ b/mysql-test/r/partition_innodb_stmt.result
@@ -42,7 +42,7 @@ id
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
INSERT INTO t1 VALUES(9);
-ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
+ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
COMMIT;
COMMIT;
DROP TABLE t1;
diff --git a/mysql-test/r/partition_key_cache.result b/mysql-test/r/partition_key_cache.result
new file mode 100644
index 00000000000..c5241c6ea90
--- /dev/null
+++ b/mysql-test/r/partition_key_cache.result
@@ -0,0 +1,415 @@
+DROP TABLE IF EXISTS t1, t2, v, x;
+# Actual test of key caches
+# Verifing that reads/writes use the key cache correctly
+SELECT @org_key_cache_buffer_size:= @@global.default.key_buffer_size;
+@org_key_cache_buffer_size:= @@global.default.key_buffer_size
+1048576
+# Minimize default key cache (almost disabled).
+SET @@global.default.key_buffer_size = 4096;
+CREATE TABLE t1 (
+a INT,
+b INT,
+c INT NOT NULL,
+PRIMARY KEY (a),
+KEY `inx_b` (b))
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION p0 VALUES LESS THAN (1167602410)
+(SUBPARTITION sp0,
+SUBPARTITION sp1),
+PARTITION p1 VALUES LESS THAN MAXVALUE
+(SUBPARTITION sp2,
+SUBPARTITION sp3));
+CREATE TABLE t2 (
+a INT,
+b INT,
+c INT NOT NULL,
+PRIMARY KEY (a),
+KEY `inx_b` (b));
+FLUSH TABLES;
+FLUSH STATUS;
+SET @a:=1167602400;
+CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4;
+CREATE VIEW x AS SELECT 1 FROM v,v a,v b;
+FLUSH STATUS;
+INSERT t1 SELECT @a, @a * (1 - ((@a % 2) * 2)) , 1167612400 - (@a:=@a+1) FROM x, x y;
+reads vs requests
+reads == requests
+writes vs requests
+writes == requests
+# row distribution:
+SELECT PARTITION_NAME, SUBPARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_SCHEMA='test' and TABLE_NAME='t1';
+PARTITION_NAME SUBPARTITION_NAME TABLE_ROWS
+p0 sp0 5
+p0 sp1 5
+p1 sp2 2043
+p1 sp3 2043
+DROP VIEW x;
+DROP VIEW v;
+FLUSH TABLES;
+FLUSH STATUS;
+SELECT COUNT(b) FROM t1 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+No!
+INSERT t2 SELECT a,b,c FROM t1;
+reads vs requests
+reads == requests
+writes vs requests
+writes == requests
+FLUSH STATUS;
+SELECT COUNT(b) FROM t2 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+No!
+FLUSH TABLES;
+# Setting the default key cache to 1M
+SET GLOBAL key_buffer_size = 1024*1024;
+FLUSH STATUS;
+# All these have to read the indexes
+LOAD INDEX INTO CACHE t1 PARTITION (p1);
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+Zero key reads?
+No!
+SELECT COUNT(b) FROM t1 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+No!
+SELECT COUNT(b) FROM t2 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+No!
+# All these should be able to use the key cache
+SELECT COUNT(b) FROM t1 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+Yes!
+SELECT COUNT(b) FROM t2 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+Yes!
+FLUSH TABLES;
+LOAD INDEX INTO CACHE t1 PARTITION (p1,p0);
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+Zero key reads?
+No!
+# should not be zero
+SELECT COUNT(b) FROM t1 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+Yes!
+LOAD INDEX INTO CACHE t2;
+Table Op Msg_type Msg_text
+test.t2 preload_keys status OK
+Zero key reads?
+No!
+# should not be zero
+SELECT COUNT(b) FROM t2 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+Yes!
+FLUSH TABLES;
+LOAD INDEX INTO CACHE t1 PARTITION (p1,p0) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+Zero key reads?
+No!
+# should not be zero
+SELECT COUNT(b) FROM t1 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+No!
+LOAD INDEX INTO CACHE t2 IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t2 preload_keys status OK
+Zero key reads?
+No!
+# should not be zero
+SELECT COUNT(b) FROM t2 WHERE b >= 0;
+COUNT(b)
+2048
+Zero key reads?
+No!
+TRUNCATE TABLE t2;
+INSERT t2 SELECT a,b,c FROM t1;
+reads vs requests
+reads != requests
+writes vs requests
+writes != requests
+DROP TABLE t1,t2;
+SET GLOBAL hot_cache.key_buffer_size = 1024*1024;
+SET GLOBAL warm_cache.key_buffer_size = 1024*1024;
+SET @@global.cold_cache.key_buffer_size = 1024*1024;
+SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d;
+a b c d
+1048576 1024 300 100
+SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d;
+a b c d
+1048576 1024 300 100
+SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d;
+a b c d
+1048576 1024 300 100
+SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d;
+a b c d
+1048576 1024 300 100
+CREATE TABLE t1 (
+a INT,
+b VARCHAR(257),
+c INT NOT NULL,
+PRIMARY KEY (a),
+KEY `inx_b` (b),
+KEY `inx_c`(c))
+PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (a)
+(PARTITION p0 VALUES LESS THAN (10)
+(SUBPARTITION sp0,
+SUBPARTITION sp1),
+PARTITION p1 VALUES LESS THAN MAXVALUE
+(SUBPARTITION sp2,
+SUBPARTITION sp3));
+CREATE TABLE t2 (
+a INT,
+b VARCHAR(257),
+c INT NOT NULL,
+PRIMARY KEY (a),
+KEY `inx_b` (b),
+KEY `inx_c`(c));
+SET @a:=1167602400;
+CREATE VIEW v AS SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4;
+CREATE VIEW x AS SELECT 1 FROM v,v a,v b;
+INSERT t1 SELECT @a, CONCAT('X_', @a, ' MySQL'), 1167612400 - (@a:=@a+1) FROM x, x a;
+DROP VIEW x;
+DROP VIEW v;
+INSERT t2 SELECT a, b, c FROM t1;
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+4096
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+4096
+FLUSH TABLES;
+# Restrict partitioned commands to partitioned tables only
+CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
+ERROR HY000: Partition management on a not partitioned table is not possible
+CACHE INDEX t2 PARTITION (p0,`p1`) INDEX (`PRIMARY`) IN hot_cache;
+ERROR HY000: Partition management on a not partitioned table is not possible
+CACHE INDEX t2 PARTITION (`p1`) INDEX (`PRIMARY`,`inx_b`) IN hot_cache;
+ERROR HY000: Partition management on a not partitioned table is not possible
+CACHE INDEX t2 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN hot_cache;
+ERROR HY000: Partition management on a not partitioned table is not possible
+# Basic key cache testing
+# The manual correctly says: "The syntax of CACHE INDEX enables you to
+# specify that only particular indexes from a table should be assigned
+# to the cache. The current implementation assigns all the table's
+# indexes to the cache, so there is no reason to specify anything
+# other than the table name."
+# So the most of the test only tests the syntax
+CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+CACHE INDEX t2 KEY (`PRIMARY`) IN warm_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+CACHE INDEX t2 KEY (`PRIMARY`,`inx_b`) IN cold_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+CACHE INDEX t2 INDEX (inx_b,`PRIMARY`) IN default;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN cold_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 PARTITIONS (p0) KEY (`inx_b`) IN cold_cache;
+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 'PARTITIONS (p0) KEY (`inx_b`) IN cold_cache' at line 1
+# only one table at a time if specifying partitions
+CACHE INDEX t1,t2 PARTITION (p0) KEY (`inx_b`) IN cold_cache;
+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 'PARTITION (p0) KEY (`inx_b`) IN cold_cache' at line 1
+CACHE INDEX t1 PARTITION (`p0`,p1) INDEX (`PRIMARY`) IN warm_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 PARTITION (`p1`) INDEX (`PRIMARY`,inx_b) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 PARTITION (ALL) KEY (`inx_b`,`PRIMARY`) IN default;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 PARTITION (ALL) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 INDEX (`inx_b`) IN default;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 KEY (`PRIMARY`) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 KEY (`PRIMARY`,`inx_b`) IN warm_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 INDEX (`inx_b`,`PRIMARY`) IN cold_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+CACHE INDEX t1 IN hot_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+# Test of non existent key cache:
+CACHE INDEX t1 IN non_existent_key_cache;
+ERROR HY000: Unknown key cache 'non_existent_key_cache'
+# Basic testing of LOAD INDEX
+LOAD INDEX INTO CACHE t2;
+Table Op Msg_type Msg_text
+test.t2 preload_keys status OK
+# PRIMARY and secondary keys have different block sizes
+LOAD INDEX INTO CACHE t2 ignore leaves;
+Table Op Msg_type Msg_text
+test.t2 preload_keys error Indexes use different block sizes
+test.t2 preload_keys status Operation failed
+# Must have INDEX or KEY before the index list
+LOAD INDEX INTO CACHE t2 (`PRIMARY`);
+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 '(`PRIMARY`)' at line 1
+# Test of IGNORE LEAVES
+LOAD INDEX INTO CACHE t2 INDEX (`PRIMARY`);
+Table Op Msg_type Msg_text
+test.t2 preload_keys status OK
+LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t2 preload_keys error Indexes use different block sizes
+test.t2 preload_keys status Operation failed
+CACHE INDEX t2 IN warm_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+CACHE INDEX t1 IN cold_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache status OK
+LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t2 preload_keys error Indexes use different block sizes
+test.t2 preload_keys status Operation failed
+CACHE INDEX t2 INDEX (`inx_b`, `inx_c`) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+LOAD INDEX INTO CACHE t2 KEY (`inx_b`, `inx_c`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t2 preload_keys error Indexes use different block sizes
+test.t2 preload_keys status Operation failed
+CACHE INDEX t2 IN warm_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+CACHE INDEX t2 INDEX (`PRIMARY`, `inx_c`) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_c`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t2 preload_keys error Indexes use different block sizes
+test.t2 preload_keys status Operation failed
+CACHE INDEX t2 INDEX (`inx_b`,`PRIMARY`) IN default;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+LOAD INDEX INTO CACHE t2 KEY (`PRIMARY`,`inx_b`);
+Table Op Msg_type Msg_text
+test.t2 preload_keys status OK
+CACHE INDEX t2 IN default;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache status OK
+LOAD INDEX INTO CACHE t2 IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t2 preload_keys error Indexes use different block sizes
+test.t2 preload_keys status Operation failed
+LOAD INDEX INTO CACHE t2 PARTITION (p1) INDEX (`PRIMARY`);
+ERROR HY000: Partition management on a not partitioned table is not possible
+LOAD INDEX INTO CACHE t1, t2;
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+test.t2 preload_keys status OK
+# only one table at a time if specifying partitions
+LOAD INDEX INTO CACHE t1 PARTITION (p0), t2;
+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 ' t2' at line 1
+LOAD INDEX INTO CACHE t1 IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t1 preload_keys error Indexes use different block sizes
+test.t1 preload_keys error Subpartition sp2 returned error
+test.t1 preload_keys status Operation failed
+LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`);
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t1 preload_keys error Indexes use different block sizes
+test.t1 preload_keys error Subpartition sp2 returned error
+test.t1 preload_keys status Operation failed
+LOAD INDEX INTO CACHE t1 INDEX (`inx_b`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t1 preload_keys error Indexes use different block sizes
+test.t1 preload_keys error Subpartition sp2 returned error
+test.t1 preload_keys status Operation failed
+LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t1 preload_keys error Indexes use different block sizes
+test.t1 preload_keys error Subpartition sp2 returned error
+test.t1 preload_keys status Operation failed
+LOAD INDEX INTO CACHE t1 INDEX (`PRIMARY`,`inx_b`);
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+LOAD INDEX INTO CACHE t1 PARTITION (p1) INDEX (`PRIMARY`);
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+LOAD INDEX INTO CACHE t1 PARTITION (`p1`,p0) KEY (`PRIMARY`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t1 preload_keys error Indexes use different block sizes
+test.t1 preload_keys error Subpartition sp2 returned error
+test.t1 preload_keys status Operation failed
+LOAD INDEX INTO CACHE t1 PARTITION (ALL);
+Table Op Msg_type Msg_text
+test.t1 preload_keys status OK
+LOAD INDEX INTO CACHE t1 PARTITIONS ALL;
+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 'PARTITIONS ALL' at line 1
+LOAD INDEX INTO CACHE t1 PARTITION (p1,`p0`) IGNORE LEAVES;
+Table Op Msg_type Msg_text
+test.t1 preload_keys error Indexes use different block sizes
+test.t1 preload_keys error Subpartition sp2 returned error
+test.t1 preload_keys status Operation failed
+DROP INDEX `inx_b` on t1;
+DROP INDEX `inx_b` on t2;
+CACHE INDEX t2 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
+ERROR HY000: Partition management on a not partitioned table is not possible
+CACHE INDEX t2 INDEX (`inx_b`) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t2 assign_to_keycache Error Key 'inx_b' doesn't exist in table 't2'
+test.t2 assign_to_keycache status Operation failed
+CACHE INDEX t1 PARTITION (p0) KEY (`inx_b`) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache error Subpartition sp0 returned error
+test.t1 assign_to_keycache Error Key 'inx_b' doesn't exist in table 't1'
+test.t1 assign_to_keycache status Operation failed
+CACHE INDEX t1 INDEX (`inx_b`) IN hot_cache;
+Table Op Msg_type Msg_text
+test.t1 assign_to_keycache error Subpartition sp0 returned error
+test.t1 assign_to_keycache Error Key 'inx_b' doesn't exist in table 't1'
+test.t1 assign_to_keycache status Operation failed
+DROP TABLE t1,t2;
+SET GLOBAL hot_cache.key_buffer_size = 0;
+SET GLOBAL warm_cache.key_buffer_size = 0;
+SET @@global.cold_cache.key_buffer_size = 0;
+SELECT @@global.default.key_buffer_size a, @@global.default.key_cache_block_size b, @@global.default.key_cache_age_threshold c, @@global.default.key_cache_division_limit d;
+a b c d
+1048576 1024 300 100
+SELECT @@global.hot_cache.key_buffer_size a, @@global.hot_cache.key_cache_block_size b, @@global.hot_cache.key_cache_age_threshold c, @@global.hot_cache.key_cache_division_limit d;
+a b c d
+0 1024 300 100
+SELECT @@global.warm_cache.key_buffer_size a, @@global.warm_cache.key_cache_block_size b, @@global.warm_cache.key_cache_age_threshold c, @@global.warm_cache.key_cache_division_limit d;
+a b c d
+0 1024 300 100
+SELECT @@global.cold_cache.key_buffer_size a, @@global.cold_cache.key_cache_block_size b, @@global.cold_cache.key_cache_age_threshold c, @@global.cold_cache.key_cache_division_limit d;
+a b c d
+0 1024 300 100
+SET @@global.default.key_buffer_size = @org_key_cache_buffer_size;
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 cf0474a3f6b..bd81e2b5d4f 100644
--- a/mysql-test/r/partition_pruning.result
+++ b/mysql-test/r/partition_pruning.result
@@ -1266,6 +1266,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,
@@ -2838,3 +3167,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..0bd7605a5c8 100644
--- a/mysql-test/r/partition_range.result
+++ b/mysql-test/r/partition_range.result
@@ -1,6 +1,136 @@
drop table if exists t1, t2;
create table t1 (a int)
partition by range (a)
+subpartition by hash(to_seconds(a))
+(partition p0 values less than (1));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE (a)
+SUBPARTITION BY HASH (to_seconds(a))
+(PARTITION p0 VALUES LESS THAN (1) ENGINE = MyISAM) */
+drop table t1;
+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
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` datetime NOT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE (TO_SECONDS(a))
+(PARTITION p0 VALUES LESS THAN (63340531200) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (63342604800) ENGINE = MyISAM) */
+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
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE (to_seconds(a))
+(PARTITION p0 VALUES LESS THAN (63240134400) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (63271756800) ENGINE = MyISAM) */
+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
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` datetime DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE (to_seconds(a))
+(PARTITION p0 VALUES LESS THAN (63240177600) ENGINE = MyISAM,
+ PARTITION p1 VALUES LESS THAN (63271800000) ENGINE = MyISAM) */
+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_sync.result b/mysql-test/r/partition_sync.result
new file mode 100644
index 00000000000..31cf0569464
--- /dev/null
+++ b/mysql-test/r/partition_sync.result
@@ -0,0 +1,25 @@
+#
+# Bug #43867 ALTER TABLE on a partitioned table
+# causes unnecessary deadlocks
+#
+CREATE TABLE t1 (a int) PARTITION BY RANGE (a)
+(PARTITION p0 VALUES LESS THAN (1),
+PARTITION p1 VALUES LESS THAN (2));
+INSERT INTO t1 VALUES (0),(1);
+# Connection 2
+BEGIN;
+SELECT * FROM t1;
+a
+0
+1
+# Connection 1
+ALTER TABLE t1 DROP PARTITION p3;
+ERROR HY000: Error in list of partitions to DROP
+# Connection 2
+# This failed with deadlock and should not do so.
+SELECT * FROM t1;
+a
+0
+1
+# Connection 1
+DROP TABLE t1;
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..339871f1f4a
--- /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
+/*!50500 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
+/*!50500 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
+/*!50500 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..0d5bc29fc8c 100644
--- a/mysql-test/r/plugin.result
+++ b/mysql-test/r/plugin.result
@@ -1,6 +1,6 @@
CREATE TABLE t1(a int) ENGINE=EXAMPLE;
Warnings:
-Warning 1286 Unknown table engine 'EXAMPLE'
+Warning 1286 Unknown storage engine 'EXAMPLE'
Warning 1266 Using storage engine MyISAM for table 't1'
DROP TABLE t1;
INSTALL PLUGIN example SONAME 'ha_example.so';
@@ -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
@@ -25,7 +34,7 @@ INSTALL PLUGIN example SONAME 'ha_example.so';
SET GLOBAL example_enum_var= e1;
SET GLOBAL example_enum_var= e2;
SET GLOBAL example_enum_var= impossible;
-ERROR 42000: Variable 'enum_var' can't be set to the value of 'impossible'
+ERROR 42000: Variable 'example_enum_var' can't be set to the value of 'impossible'
UNINSTALL PLUGIN example;
INSTALL PLUGIN example SONAME 'ha_example.so';
select @@session.sql_mode into @old_sql_mode;
@@ -36,7 +45,7 @@ select @@global.example_ulong_var;
500
set global example_ulong_var=1111;
Warnings:
-Warning 1292 Truncated incorrect ulong_var value: '1111'
+Warning 1292 Truncated incorrect example_ulong_var value: '1111'
select @@global.example_ulong_var;
@@global.example_ulong_var
1000
@@ -46,7 +55,7 @@ select @@global.example_ulong_var;
@@global.example_ulong_var
500
set global example_ulong_var=1111;
-ERROR 42000: Variable 'ulong_var' can't be set to the value of '1111'
+ERROR 42000: Variable 'example_ulong_var' can't be set to the value of '1111'
select @@global.example_ulong_var;
@@global.example_ulong_var
500
diff --git a/mysql-test/r/profiling.result b/mysql-test/r/profiling.result
index c96074eb830..6292cd085e4 100644
--- a/mysql-test/r/profiling.result
+++ b/mysql-test/r/profiling.result
@@ -9,8 +9,6 @@ profiling_history_size 15
select @@profiling;
@@profiling
0
-set global profiling = ON;
-ERROR HY000: Variable 'profiling' is a SESSION variable and can't be used with SET GLOBAL
set @start_value= @@global.profiling_history_size;
set global profiling_history_size=100;
show global variables like 'profil%';
@@ -298,6 +296,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 1e67bfa7d37..c9628e43ddd 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|
@@ -2795,17 +2795,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
@@ -2988,4 +2992,165 @@ select @plaintext;
bcd
deallocate prepare encode;
deallocate prepare decode;
+
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..4f6e5238c3f 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -262,6 +262,7 @@ Database
information_schema
mtr
mysql
+performance_schema
test
prepare stmt4 from ' show tables from test like ''t2%'' ';
execute stmt4;
@@ -279,6 +280,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
@@ -409,8 +413,6 @@ prepare stmt1 from ' optimize table t1 ' ;
prepare stmt1 from ' analyze table t1 ' ;
prepare stmt1 from ' checksum table t1 ' ;
prepare stmt1 from ' repair table t1 ' ;
-prepare stmt1 from ' restore table t1 from ''<MYSQLTEST_VARDIR>/tmp/data.txt'' ' ;
-ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt1 from ' handler t1 open ';
ERROR HY000: This command is not supported in the prepared statement protocol yet
prepare stmt3 from ' commit ' ;
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index a91d13d11a1..4f9444c1542 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
@@ -2585,10 +2585,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= '9223372036854775807' ;
@@ -2608,10 +2608,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= -9223372036854775808 ;
@@ -2631,10 +2631,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= '-9223372036854775808' ;
@@ -2654,10 +2654,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= 1.11111111111111111111e+50 ;
@@ -2679,10 +2679,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= '1.11111111111111111111e+50' ;
@@ -2704,10 +2704,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
@@ -2729,10 +2729,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
set @arg00= '-1.11111111111111111111e+50' ;
@@ -2754,10 +2754,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
test_sequence
@@ -2822,10 +2822,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0
52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
+54 5 54 54 54 54 54 54 54 54 54 54
+55 6 55 55 55 55 55 55 55 55 55 55
+56 6 56 56 56 56 56 56 56 56 56 56
+57 6 57 57 57 57 57 57 57 57 57 57
60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
@@ -3039,7 +3039,7 @@ c1 c13 c14 c15 c16 c17
42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
60 NULL NULL 1991-01-01 01:01:01 NULL NULL
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 50c94d6cc4e..772a7462342 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
@@ -2568,10 +2568,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= '9223372036854775807' ;
@@ -2591,10 +2591,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= -9223372036854775808 ;
@@ -2614,10 +2614,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= '-9223372036854775808' ;
@@ -2637,10 +2637,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= 1.11111111111111111111e+50 ;
@@ -2662,10 +2662,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= '1.11111111111111111111e+50' ;
@@ -2687,10 +2687,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
@@ -2712,10 +2712,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
set @arg00= '-1.11111111111111111111e+50' ;
@@ -2737,10 +2737,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
test_sequence
@@ -2805,10 +2805,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0
52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
+54 5 54 54 54 54 54 54 54 54 54 54
+55 6 55 55 55 55 55 55 55 55 55 55
+56 6 56 56 56 56 56 56 56 56 56 56
+57 6 57 57 57 57 57 57 57 57 57 57
60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
@@ -3022,7 +3022,7 @@ c1 c13 c14 c15 c16 c17
42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
60 NULL NULL 1991-01-01 01:01:01 NULL NULL
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index a85809d3800..84bf7a6fa00 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
@@ -2569,10 +2569,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= '9223372036854775807' ;
@@ -2592,10 +2592,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= -9223372036854775808 ;
@@ -2615,10 +2615,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= '-9223372036854775808' ;
@@ -2638,10 +2638,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= 1.11111111111111111111e+50 ;
@@ -2663,10 +2663,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= '1.11111111111111111111e+50' ;
@@ -2688,10 +2688,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
@@ -2713,10 +2713,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
set @arg00= '-1.11111111111111111111e+50' ;
@@ -2738,10 +2738,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
test_sequence
@@ -2807,7 +2807,7 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
54 5 54 54 54 54 54 54 54 54 54 54
-55 5 55 55 55 55 55 55 55 55 55 55
+55 6 55 55 55 55 55 55 55 55 55 55
56 6 56 56 56 56 56 56 56 56 56 56
57 6 57 57 57 57 57 57 57 57 57 57
60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
@@ -3023,7 +3023,7 @@ c1 c13 c14 c15 c16 c17
42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
60 NULL NULL 1991-01-01 01:01:01 NULL NULL
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index fd1b69c0ffd..61d2822fd5b 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
@@ -2505,10 +2505,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= '9223372036854775807' ;
@@ -2528,10 +2528,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= -9223372036854775808 ;
@@ -2551,10 +2551,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= '-9223372036854775808' ;
@@ -2574,10 +2574,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= 1.11111111111111111111e+50 ;
@@ -2599,10 +2599,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= '1.11111111111111111111e+50' ;
@@ -2624,10 +2624,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
@@ -2649,10 +2649,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
set @arg00= '-1.11111111111111111111e+50' ;
@@ -2674,10 +2674,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
test_sequence
@@ -2742,10 +2742,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0
52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
+54 5 54 54 54 54 54 54 54 54 54 54
+55 6 55 55 55 55 55 55 55 55 55 55
+56 6 56 56 56 56 56 56 56 56 56 56
+57 6 57 57 57 57 57 57 57 57 57 57
60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
@@ -2959,7 +2959,7 @@ c1 c13 c14 c15 c16 c17
42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
60 NULL NULL 1991-01-01 01:01:01 NULL NULL
@@ -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
@@ -5527,10 +5527,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= '9223372036854775807' ;
@@ -5550,10 +5550,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 9.22337e+18
-c8 9.22337203685478e+18
-c9 9.22337203685478e+18
-c10 9.22337203685478e+18
+c7 9.22337e18
+c8 9.223372036854776e18
+c9 9.223372036854776e18
+c10 9.223372036854776e18
c12 9999.9999
execute my_delete ;
set @arg00= -9223372036854775808 ;
@@ -5573,10 +5573,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= '-9223372036854775808' ;
@@ -5596,10 +5596,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -9.22337e+18
-c8 -9.22337203685478e+18
-c9 -9.22337203685478e+18
-c10 -9.22337203685478e+18
+c7 -9.22337e18
+c8 -9.223372036854776e18
+c9 -9.223372036854776e18
+c10 -9.223372036854776e18
c12 -9999.9999
execute my_delete ;
set @arg00= 1.11111111111111111111e+50 ;
@@ -5621,10 +5621,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= '1.11111111111111111111e+50' ;
@@ -5646,10 +5646,10 @@ c3 8388607
c4 2147483647
c5 2147483647
c6 9223372036854775807
-c7 3.40282e+38
-c8 1.11111111111111e+50
-c9 1.11111111111111e+50
-c10 1.11111111111111e+50
+c7 3.40282e38
+c8 1.111111111111111e50
+c9 1.111111111111111e50
+c10 1.111111111111111e50
c12 9999.9999
execute my_delete ;
set @arg00= -1.11111111111111111111e+50 ;
@@ -5671,10 +5671,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
set @arg00= '-1.11111111111111111111e+50' ;
@@ -5696,10 +5696,10 @@ c3 -8388608
c4 -2147483648
c5 -2147483648
c6 -9223372036854775808
-c7 -3.40282e+38
-c8 -1.11111111111111e+50
-c9 -1.11111111111111e+50
-c10 -1.11111111111111e+50
+c7 -3.40282e38
+c8 -1.111111111111111e50
+c9 -1.111111111111111e50
+c10 -1.111111111111111e50
c12 -9999.9999
execute my_delete ;
test_sequence
@@ -5764,10 +5764,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30
51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0
52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0
53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0
-54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00
-55 5 55 55 55 55 55 55 55 55 55 55
-56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00
-57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00
+54 5 54 54 54 54 54 54 54 54 54 54
+55 6 55 55 55 55 55 55 55 55 55 55
+56 6 56 56 56 56 56 56 56 56 56 56
+57 6 57 57 57 57 57 57 57 57 57 57
60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL
@@ -5981,7 +5981,7 @@ c1 c13 c14 c15 c16 c17
42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
-51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
+51 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000
60 NULL NULL 1991-01-01 01:01:01 NULL NULL
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 2817bec2198..eab0c51f974 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -176,21 +176,6 @@ a
1
2
3
-select * from t1 union select sql_cache * from t1;
-a
-1
-2
-3
-select * from t1 where a IN (select sql_cache a from t1);
-a
-1
-2
-3
-select * from t1 where a IN (select a from t1 union select sql_cache a from t1);
-a
-1
-2
-3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
@@ -207,41 +192,6 @@ a
1
2
3
-select * from t1 union select sql_no_cache * from t1;
-a
-1
-2
-3
-select * from t1 where a IN (select sql_no_cache a from t1);
-a
-1
-2
-3
-select * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
-a
-1
-2
-3
-select sql_cache sql_no_cache * from t1;
-a
-1
-2
-3
-select sql_cache * from t1 union select sql_no_cache * from t1;
-a
-1
-2
-3
-select sql_cache * from t1 where a IN (select sql_no_cache a from t1);
-a
-1
-2
-3
-select sql_cache * from t1 where a IN (select a from t1 union select sql_no_cache a from t1);
-a
-1
-2
-3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
@@ -342,19 +292,18 @@ create table mysqltest.t1 (i int not null auto_increment, a int, primary key (i)
insert into mysqltest.t1 (a) values (1);
select * from mysqltest.t1 where i is null;
i a
-1 1
create table t1(a int);
select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
-Qcache_queries_in_cache 1
+Qcache_queries_in_cache 2
select * from mysqltest.t1;
i a
1 1
show status like "Qcache_queries_in_cache";
Variable_name Value
-Qcache_queries_in_cache 2
+Qcache_queries_in_cache 3
drop database mysqltest;
show status like "Qcache_queries_in_cache";
Variable_name Value
@@ -559,6 +508,8 @@ AAA
drop table t1;
create table t1 (a int);
set GLOBAL query_cache_size=1000;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '1000'
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
@@ -889,7 +840,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 +943,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
@@ -1393,9 +1344,9 @@ set global query_cache_size=0;
create table t1 (a int);
insert into t1 values (1),(2),(3);
set GLOBAL query_cache_type=1;
-set GLOBAL query_cache_limit=10000;
+set GLOBAL query_cache_limit=10240;
set GLOBAL query_cache_min_res_unit=0;
-set GLOBAL query_cache_size= 100000;
+set GLOBAL query_cache_size= 102400;
reset query cache;
set LOCAL default_week_format = 0;
select week('2007-01-04');
@@ -1485,13 +1436,7 @@ set GLOBAL query_cache_type=default;
set GLOBAL query_cache_limit=default;
set GLOBAL query_cache_min_res_unit=default;
set GLOBAL query_cache_size= default;
-set GLOBAL query_cache_size=1000000;
-create table t1 (a char);
-insert into t1 values ('c');
-a
-drop table t1;
-set GLOBAL query_cache_size= default;
-set GLOBAL query_cache_size=1000000;
+set GLOBAL query_cache_size=1024000;
create table t1 (a char);
insert into t1 values ('c');
a
@@ -1619,7 +1564,7 @@ SET GLOBAL query_cache_size= default;
#
# Bug#25132 disabled query cache: Qcache_free_blocks = 1
#
-set global query_cache_size=100000;
+set global query_cache_size=102400;
set global query_cache_size=0;
set global query_cache_type=0;
show status like 'Qcache_free_blocks';
@@ -1638,7 +1583,7 @@ CREATE TABLE t1 (c1 INT NOT NULL) ENGINE=MyISAM;
INSERT INTO t1 (c1) VALUES (1), (2);
SHOW GLOBAL VARIABLES LIKE 'concurrent_insert';
Variable_name Value
-concurrent_insert 0
+concurrent_insert NEVER
SHOW STATUS LIKE 'Qcache_hits';
Variable_name Value
Qcache_hits 0
@@ -1724,4 +1669,55 @@ SELECT 1 FROM t1 GROUP BY
1
DROP TABLE t1;
SET GLOBAL query_cache_size= default;
+CREATE TABLE t1( a INT );
+SET @v = ( SELECT SQL_CACHE 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
+SET @v = ( SELECT SQL_NO_CACHE 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
+SELECT a FROM t1 WHERE a IN ( SELECT SQL_CACHE a FROM t1 );
+ERROR 42S22: Unknown column 'SQL_CACHE' in 'field list'
+SELECT a FROM t1 WHERE a IN ( SELECT SQL_NO_CACHE a FROM t1 );
+ERROR 42S22: Unknown column 'SQL_NO_CACHE' in 'field list'
+SELECT ( SELECT SQL_CACHE a FROM t1 );
+ERROR 42S22: Unknown column 'SQL_CACHE' in 'field list'
+SELECT ( SELECT SQL_NO_CACHE a FROM t1 );
+ERROR 42S22: Unknown column 'SQL_NO_CACHE' in 'field list'
+SELECT SQL_CACHE * FROM t1;
+a
+SELECT SQL_NO_CACHE * FROM t1;
+a
+SELECT * FROM t1 UNION SELECT SQL_CACHE * FROM t1;
+ERROR 42000: Incorrect usage/placement of 'SQL_CACHE'
+SELECT * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
+ERROR 42000: Incorrect usage/placement of 'SQL_NO_CACHE'
+SELECT * FROM t1 WHERE a IN (SELECT SQL_CACHE a FROM t1);
+ERROR 42S22: Unknown column 'SQL_CACHE' in 'field list'
+SELECT * FROM t1 WHERE a IN (SELECT a FROM t1 UNION SELECT SQL_CACHE a FROM t1);
+ERROR 42S22: Unknown column 'SQL_CACHE' in 'field list'
+SELECT * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
+ERROR 42000: Incorrect usage/placement of 'SQL_NO_CACHE'
+SELECT * FROM t1 WHERE a IN (SELECT SQL_NO_CACHE a FROM t1);
+ERROR 42S22: Unknown column 'SQL_NO_CACHE' in 'field list'
+SELECT * FROM t1 WHERE a IN
+(SELECT a FROM t1 UNION SELECT SQL_NO_CACHE a FROM t1);
+ERROR 42S22: Unknown column 'SQL_NO_CACHE' in 'field list'
+SELECT SQL_CACHE SQL_NO_CACHE * FROM t1;
+ERROR HY000: Incorrect usage of SQL_CACHE and SQL_NO_CACHE
+SELECT SQL_NO_CACHE SQL_CACHE * FROM t1;
+ERROR HY000: Incorrect usage of SQL_NO_CACHE and SQL_CACHE
+SELECT SQL_CACHE * FROM t1 UNION SELECT SQL_CACHE * FROM t1;
+ERROR 42000: Incorrect usage/placement of 'SQL_CACHE'
+SELECT SQL_CACHE * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
+ERROR 42000: Incorrect usage/placement of 'SQL_NO_CACHE'
+SELECT SQL_NO_CACHE * FROM t1 UNION SELECT SQL_CACHE * FROM t1;
+ERROR 42000: Incorrect usage/placement of 'SQL_CACHE'
+SELECT SQL_NO_CACHE * FROM t1 UNION SELECT SQL_NO_CACHE * FROM t1;
+ERROR 42000: Incorrect usage/placement of 'SQL_NO_CACHE'
+SELECT SQL_CACHE * FROM t1 WHERE a IN
+(SELECT SQL_NO_CACHE a FROM t1);
+ERROR 42S22: Unknown column 'SQL_NO_CACHE' in 'field list'
+SELECT SQL_CACHE * FROM t1 WHERE a IN
+(SELECT a FROM t1 UNION SELECT SQL_NO_CACHE a FROM t1);
+ERROR 42S22: Unknown column 'SQL_NO_CACHE' in 'field list'
+DROP TABLE t1;
End of 5.1 tests
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_notembedded.result b/mysql-test/r/query_cache_notembedded.result
index d9bf7a6d814..25894634bf3 100644
--- a/mysql-test/r/query_cache_notembedded.result
+++ b/mysql-test/r/query_cache_notembedded.result
@@ -93,6 +93,7 @@ a
3
SELECT * FROM t1;
a
+UNLOCK TABLES;
drop table t1;
flush query cache;
reset query cache;
diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result
index 0efb2540c64..02e660450d1 100644
--- a/mysql-test/r/query_cache_ps_no_prot.result
+++ b/mysql-test/r/query_cache_ps_no_prot.result
@@ -1,7 +1,7 @@
---- establish connection con1 (root) ----
---- switch to connection default ----
set @initial_query_cache_size = @@global.query_cache_size;
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
flush status;
drop table if exists t1;
create table t1(c1 int);
@@ -211,7 +211,7 @@ show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 16
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
execute stmt1;
c1
10
@@ -297,7 +297,7 @@ prepare stmt1 from "select * from t1 where c1=10";
---- switch to connection con1 ----
prepare stmt3 from "select * from t1 where c1=10";
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
@@ -344,7 +344,7 @@ Qcache_hits 21
---- switch to connection default ----
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=?";
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
@@ -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=102400;
+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..2115ecc62ff 100644
--- a/mysql-test/r/query_cache_ps_ps_prot.result
+++ b/mysql-test/r/query_cache_ps_ps_prot.result
@@ -1,7 +1,7 @@
---- establish connection con1 (root) ----
---- switch to connection default ----
set @initial_query_cache_size = @@global.query_cache_size;
-set @@global.query_cache_size=100000;
+set @@global.query_cache_size=102400;
flush status;
drop table if exists t1;
create table t1(c1 int);
@@ -211,7 +211,7 @@ show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 14
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
execute stmt1;
c1
10
@@ -297,7 +297,7 @@ prepare stmt1 from "select * from t1 where c1=10";
---- switch to connection con1 ----
prepare stmt3 from "select * from t1 where c1=10";
---- switch to connection default ----
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
@@ -344,7 +344,7 @@ Qcache_hits 19
---- switch to connection default ----
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=?";
-set global query_cache_size=100000;
+set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
@@ -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=102400;
+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/rpl_mysqldump_slave.result b/mysql-test/r/rpl_mysqldump_slave.result
new file mode 100644
index 00000000000..158a43a658c
--- /dev/null
+++ b/mysql-test/r/rpl_mysqldump_slave.result
@@ -0,0 +1,17 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+#
+# New --dump-slave, --apply-slave-statements functionality
+#
+use test;
+CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=107;
+STOP SLAVE;
+CHANGE MASTER TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=107;
+START SLAVE;
+STOP SLAVE;
+CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT='MASTER_MYPORT', MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=107;
+START SLAVE;
diff --git a/mysql-test/r/schema.result b/mysql-test/r/schema.result
index 564fb3626df..402d3e1d987 100644
--- a/mysql-test/r/schema.result
+++ b/mysql-test/r/schema.result
@@ -9,5 +9,6 @@ information_schema
foo
mtr
mysql
+performance_schema
test
drop schema foo;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index dce927a5c8d..41dd44fc4d0 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2784,26 +2784,26 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
select max(key1) from t1 where key1 <= 0.6158;
max(key1)
-0.615800023078918
+0.6158000230789185
select max(key2) from t2 where key2 <= 1.6158;
max(key2)
-1.61580002307892
+1.6158000230789185
select min(key1) from t1 where key1 >= 0.3762;
min(key1)
-0.376199990510941
+0.37619999051094055
select min(key2) from t2 where key2 >= 1.3762;
min(key2)
-1.37619996070862
+1.3761999607086182
select max(key1), min(key2) from t1, t2
where key1 <= 0.6158 and key2 >= 1.3762;
max(key1) min(key2)
-0.615800023078918 1.37619996070862
+0.6158000230789185 1.3761999607086182
select max(key1) from t1 where key1 <= 0.6158 and rand() + 0.5 >= 0.5;
max(key1)
-0.615800023078918
+0.6158000230789185
select min(key1) from t1 where key1 >= 0.3762 and rand() + 0.5 >= 0.5;
min(key1)
-0.376199990510941
+0.37619999051094055
DROP TABLE t1,t2;
CREATE TABLE t1 (i BIGINT UNSIGNED NOT NULL);
INSERT INTO t1 VALUES (10);
@@ -4423,9 +4423,14 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (2),(3);
# Should not crash
SELECT 1 FROM t1 WHERE a <> 1 AND NOT
-ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1))
+ROW(1,a) <=> ROW(1,(SELECT 1 FROM t1))
INTO @var0;
ERROR 21000: Subquery returns more than 1 row
+SELECT 1 FROM t1 WHERE a <> 1 AND NOT
+ROW(a,a) <=> ROW((SELECT 1 FROM t1 WHERE 1=2),(SELECT 1 FROM t1));
+1
+1
+1
DROP TABLE t1;
#
# Bug #48458: simple query tries to allocate enormous amount of
@@ -4454,7 +4459,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
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 '2001-01-01 00:00:00' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01');
@@ -4465,7 +4470,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
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 '2001-01-01' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a TIMESTAMP NOT NULL);
INSERT INTO t1 VALUES('2001-01-01');
@@ -4476,7 +4481,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a='2001-01-01 00:00:0
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 '2001-01-01 00:00:00' AS `a` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4487,7 +4492,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01
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 '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b VARCHAR(20) NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4497,7 +4502,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a=b AND b='2001-01-01
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 '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 0
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 0
SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND b='2001-01-01';
a b
2001-01-01 00:00:00 2001-01-01
@@ -4505,7 +4510,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01 00:00:00' AND a=b AND 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 '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from `test`.`t1` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01' AS `b` from dual where 1
DROP TABLE t1;
CREATE TABLE t1(a DATETIME NOT NULL, b DATE NOT NULL);
INSERT INTO t1 VALUES('2001-01-01', '2001-01-01');
@@ -4524,7 +4529,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE y system NULL NULL NULL NULL 1 100.00
1 SIMPLE z system NULL NULL NULL NULL 1 100.00
Warnings:
-Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from `test`.`t1` `x` join `test`.`t1` `y` join `test`.`t1` `z` where 1
+Note 1003 select '2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a`,'2001-01-01 00:00:00' AS `a` from dual where 1
DROP TABLE t1;
End of 5.0 tests
create table t1(a INT, KEY (a));
@@ -4575,7 +4580,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
@@ -4676,6 +4681,72 @@ field2
15:13:38
drop table A,AA,B,BB;
#end of test for bug#45266
+#
+# Bug#33546: Slowdown on re-evaluation of constant expressions.
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE t2 (b INT);
+INSERT INTO t2 VALUES (2);
+SELECT * FROM t1 WHERE a = 1 + 1;
+a
+2
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>((1 + 1)))
+SELECT * FROM t1 HAVING a = 1 + 1;
+a
+2
+EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = <cache>((1 + 1)))
+SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
+a b
+4 2
+EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,'2' AS `b` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(('2' + (1 + 1))))
+SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
+b a
+2 3
+EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t2 system NULL NULL NULL NULL 1 100.00
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
+Warnings:
+Note 1003 select '2' AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t1` where 1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > <cache>(unix_timestamp('2009-03-10 00:00:00')))
+CREATE FUNCTION f1() RETURNS INT DETERMINISTIC
+BEGIN
+SET @cnt := @cnt + 1;
+RETURN 1;
+END;|
+SET @cnt := 0;
+SELECT * FROM t1 WHERE a = f1();
+a
+1
+SELECT @cnt;
+@cnt
+1
+EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = f1();
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>(`f1`()))
+DROP TABLE t1, t2;
+DROP FUNCTION f1;
+# End of bug#33546
#
# BUG#48052: Valgrind warning - uninitialized value in init_read_record()
#
diff --git a/mysql-test/r/select_safe.result b/mysql-test/r/select_safe.result
index feac9efcb13..5e5ef55477c 100644
--- a/mysql-test/r/select_safe.result
+++ b/mysql-test/r/select_safe.result
@@ -1,5 +1,5 @@
drop table if exists t1;
-SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, SQL_MAX_JOIN_SIZE=9;
+SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=4, MAX_JOIN_SIZE=9;
create table t1 (a int auto_increment primary key, b char(20));
insert into t1 values(1,"test");
SELECT SQL_BUFFER_RESULT * from t1;
@@ -90,4 +90,4 @@ set local max_join_size=1;
select * from (select 1 union select 2 union select 3) x;
ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay
drop table t1;
-SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, SQL_MAX_JOIN_SIZE=DEFAULT;
+SET SQL_SAFE_UPDATES=0,SQL_SELECT_LIMIT=DEFAULT, MAX_JOIN_SIZE=DEFAULT;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index ec0a70ff581..22b5b29a0c1 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,53 +99,54 @@ 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
mysql
+performance_schema
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 +627,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;
@@ -737,20 +738,11 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
DROP VIEW v1;
CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE NOW();
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
-DROP VIEW v1;
+ERROR HY000: Incorrect usage of SQL_CACHE and SQL_NO_CACHE
CREATE VIEW v1 AS SELECT SQL_NO_CACHE SQL_CACHE NOW();
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
-DROP VIEW v1;
+ERROR HY000: Incorrect usage of SQL_NO_CACHE and SQL_CACHE
CREATE VIEW v1 AS SELECT SQL_CACHE SQL_NO_CACHE SQL_CACHE NOW();
-SHOW CREATE VIEW v1;
-View Create View character_set_client collation_connection
-v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select sql_no_cache now() AS `NOW()` binary binary
-DROP VIEW v1;
+ERROR HY000: Incorrect usage of SQL_CACHE and SQL_NO_CACHE
CREATE PROCEDURE p1()
BEGIN
SET @s= 'CREATE VIEW v1 AS SELECT SQL_CACHE 1';
@@ -808,8 +800,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;
show contributors;
@@ -859,21 +849,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 +876,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 +892,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 +920,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 +950,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 +1021,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 +1054,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 +1101,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 252 589815 0 Y 16 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 +1156,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 252 589815 7 Y 16 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;
@@ -1292,11 +1282,6 @@ delete from mysql.db where user='mysqltest_4';
delete from mysql.tables_priv where user='mysqltest_4';
flush privileges;
drop database mysqltest;
-show full plugin;
-show warnings;
-Level Code Message
-Warning 1287 The syntax 'SHOW PLUGIN' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW PLUGINS' instead
-show plugin;
show plugins;
create database `mysqlttest\1`;
create table `mysqlttest\1`.`a\b` (a int);
@@ -1314,13 +1299,13 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
drop table `mysqlttest\1`.`a\b`;
drop database `mysqlttest\1`;
show engine foobar status;
-ERROR 42000: Unknown table engine 'foobar'
+ERROR 42000: Unknown storage engine 'foobar'
show engine foobar logs;
-ERROR 42000: Unknown table engine 'foobar'
+ERROR 42000: Unknown storage engine 'foobar'
show engine foobar mutex;
-ERROR 42000: Unknown table engine 'foobar'
+ERROR 42000: Unknown storage engine 'foobar'
show engine mutex status;
-ERROR 42000: Unknown table engine 'mutex'
+ERROR 42000: Unknown storage engine 'mutex'
show engine csv status;
Type Name Status
show engine csv logs;
@@ -1442,13 +1427,12 @@ 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;
DROP TABLE t1;
DROP EVENT ev1;
-SHOW TABLE TYPES;
CREATE USER test_u@localhost;
GRANT PROCESS ON *.* TO test_u@localhost;
SHOW ENGINE MYISAM MUTEX;
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..2ecba4701fa
--- /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 131 "SIGNAL foo"
+1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 132 "RESIGNAL foo"
+3 stmt 132 "RESIGNAL foo SET MESSAGE_TEXT = "This..."
+drop procedure signal_proc;
+show function code signal_func;
+Pos Instruction
+0 stmt 131 "SIGNAL foo"
+1 stmt 131 "SIGNAL foo SET MESSAGE_TEXT = "This i..."
+2 stmt 132 "RESIGNAL foo"
+3 stmt 132 "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..0a0f620b80a 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 89 "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 89 "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-error.result b/mysql-test/r/sp-error.result
index b3968ea7eb6..00ae7dd4eca 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -921,10 +921,6 @@ CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN DROP TRIGGER test1; EN
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE FUNCTION bug_13627_f() returns int BEGIN DROP TRIGGER test1; return 1; END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
-CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN load table t1 from master; END |
-ERROR 0A000: LOAD TABLE is not allowed in stored procedures
-CREATE FUNCTION bug_13627_f() returns int BEGIN load table t1 from master; return 1; END |
-ERROR 0A000: LOAD TABLE is not allowed in stored procedures
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW BEGIN create table t2 (a int); END |
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
CREATE FUNCTION bug_13627_f() returns int BEGIN create table t2 (a int); return 1; END |
@@ -1115,18 +1111,6 @@ REPAIR TABLE t1;
RETURN 1;
END|
ERROR 0A000: Not allowed to return a result set from a function
-CREATE FUNCTION bug13012() RETURNS INT
-BEGIN
-BACKUP TABLE t1 TO '/tmp';
-RETURN 1;
-END|
-ERROR 0A000: Not allowed to return a result set from a function
-CREATE FUNCTION bug13012() RETURNS INT
-BEGIN
-RESTORE TABLE t1 FROM '/tmp';
-RETURN 1;
-END|
-ERROR 0A000: Not allowed to return a result set from a function
create table t1 (a int)|
CREATE PROCEDURE bug13012_1() REPAIR TABLE t1|
CREATE FUNCTION bug13012_2() RETURNS INT
@@ -1639,11 +1623,9 @@ DROP TABLE t1|
drop procedure if exists p1;
create procedure p1()
begin
-create table t1 (a int) type=MyISAM;
+create table t1 (a int) engine=MyISAM;
drop table t1;
end|
-Warnings:
-Warning 1287 The syntax 'TYPE=storage_engine' is deprecated and will be removed in MySQL 6.0. Please use 'ENGINE=storage_engine' instead
call p1();
call p1();
drop procedure p1;
@@ -1659,6 +1641,41 @@ begin
declare continue handler for sqlstate '00000' set @x=0;
end$$
ERROR 42000: Bad SQLSTATE: '00000'
+drop procedure if exists proc_36510;
+create procedure proc_36510()
+begin
+declare should_be_illegal condition for sqlstate '00123';
+declare continue handler for should_be_illegal set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00123'
+create procedure proc_36510()
+begin
+declare continue handler for sqlstate '00123' set @x=0;
+end$$
+ERROR 42000: Bad SQLSTATE: '00123'
+create procedure proc_36510()
+begin
+declare should_be_illegal condition for 0;
+declare continue handler for should_be_illegal set @x=0;
+end$$
+ERROR HY000: Incorrect CONDITION value: '0'
+create procedure proc_36510()
+begin
+declare continue handler for 0 set @x=0;
+end$$
+ERROR HY000: Incorrect CONDITION value: '0'
+drop procedure if exists p1;
+set @old_recursion_depth = @@max_sp_recursion_depth;
+set @@max_sp_recursion_depth = 255;
+create procedure p1(a int)
+begin
+declare continue handler for 1436 -- ER_STACK_OVERRUN_NEED_MORE
+select 'exception';
+call p1(a+1);
+end|
+call p1(1);
+set @@max_sp_recursion_depth = @old_recursion_depth;
+drop procedure p1;
LOAD DATA INFILE '../../tmp/proc.txt' INTO TABLE mysql.proc;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,1), (2,2);
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-ucs2.result b/mysql-test/r/sp-ucs2.result
index 1c266e38d97..aa87e8865ed 100644
--- a/mysql-test/r/sp-ucs2.result
+++ b/mysql-test/r/sp-ucs2.result
@@ -12,6 +12,114 @@ a
foo string
drop function bug17615|
drop table t3|
+CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci)
+RETURNS VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_danish_ci
+BEGIN
+DECLARE f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_swedish_ci;
+DECLARE f3 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_bin;
+SET f1= concat(collation(f1), ' ', collation(f2), ' ', collation(f3));
+RETURN f1;
+END|
+SELECT f('a')|
+f('a')
+ucs2_unicode_ci ucs2_swedish_ci ucs2_bin
+SELECT collation(f('a'))|
+collation(f('a'))
+ucs2_danish_ci
+DROP FUNCTION f|
+CREATE FUNCTION f()
+RETURNS VARCHAR(64) UNICODE BINARY
+BEGIN
+RETURN '';
+END|
+SHOW CREATE FUNCTION f;
+DROP FUNCTION f;
+CREATE FUNCTION f()
+RETURNS VARCHAR(64) BINARY UNICODE
+BEGIN
+RETURN '';
+END|
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
+BEGIN
+RETURN '';
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f;
+DROP FUNCTION f;
+#
+# Testing keywords ASCII + BINARY
+#
+CREATE FUNCTION f()
+RETURNS VARCHAR(64) ASCII BINARY
+BEGIN
+RETURN '';
+END|
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
+BEGIN
+RETURN '';
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f;
+DROP FUNCTION f;
+CREATE FUNCTION f()
+RETURNS VARCHAR(64) BINARY ASCII
+BEGIN
+RETURN '';
+END|
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
+BEGIN
+RETURN '';
+END latin1 latin1_swedish_ci latin1_swedish_ci
+SHOW CREATE FUNCTION f;
+DROP FUNCTION f;
+#
+# Testing COLLATE in OUT parameter
+#
+CREATE PROCEDURE p1(IN f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_czech_ci,
+OUT f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_polish_ci)
+BEGIN
+SET f2= f1;
+SET f2= concat(collation(f1), ' ', collation(f2));
+END|
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
+BEGIN
+RETURN '';
+END latin1 latin1_swedish_ci latin1_swedish_ci
+CREATE FUNCTION f1()
+RETURNS VARCHAR(64) CHARACTER SET ucs2
+BEGIN
+DECLARE f1 VARCHAR(64) CHARACTER SET ucs2;
+DECLARE f2 VARCHAR(64) CHARACTER SET ucs2;
+SET f1='str';
+CALL p1(f1, f2);
+RETURN f2;
+END|
+SELECT f1()|
+f1()
+ucs2_czech_ci ucs2_polish_ci
+DROP PROCEDURE p1|
+DROP FUNCTION f1|
+CREATE FUNCTION f(f1 VARCHAR(64) COLLATE ucs2_unicode_ci)
+RETURNS VARCHAR(64) CHARACTER SET ucs2
+BEGIN
+RETURN 'str';
+END|
+ERROR 42000: This version of MySQL doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE'
+CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
+RETURNS VARCHAR(64) COLLATE ucs2_unicode_ci
+BEGIN
+RETURN 'str';
+END|
+ERROR 42000: This version of MySQL doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE'
+CREATE FUNCTION f(f1 VARCHAR(64) CHARACTER SET ucs2)
+RETURNS VARCHAR(64) CHARACTER SET ucs2
+BEGIN
+DECLARE f2 VARCHAR(64) COLLATE ucs2_unicode_ci;
+RETURN 'str';
+END|
+ERROR 42000: This version of MySQL doesn't yet support 'COLLATE with no CHARACTER SET in SP parameters, RETURNS, DECLARE'
SET NAMES utf8;
DROP FUNCTION IF EXISTS bug48766;
CREATE FUNCTION bug48766 ()
@@ -24,7 +132,7 @@ RETURN 0 utf8 utf8_general_ci latin1_swedish_ci
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME='bug48766';
DTD_IDENTIFIER
-enum('w') CHARSET ucs2
+enum('w')
DROP FUNCTION bug48766;
CREATE FUNCTION bug48766 ()
RETURNS ENUM('а','б','в','г') CHARACTER SET ucs2
@@ -36,5 +144,5 @@ RETURN 0 utf8 utf8_general_ci latin1_swedish_ci
SELECT DTD_IDENTIFIER FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_NAME='bug48766';
DTD_IDENTIFIER
-enum('а','б','в','г') CHARSET ucs2
+enum('а','б','в','г')
DROP FUNCTION bug48766;
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 1e6227e7380..29af7a51283 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
@@ -581,7 +579,7 @@ return 2.7182818284590452354|
set @e = e()|
select e(), @e|
e() @e
-2.71828182845905 2.71828182845905
+2.718281828459045 2.718281828459045
drop function if exists inc|
create function inc(i int) returns int
return i+1|
@@ -618,23 +616,23 @@ create function fun(d double, i int, u int unsigned) returns double
return mul(inc(i), fac(u)) / e()|
select fun(2.3, 3, 5)|
fun(2.3, 3, 5)
-176.582131762292
+176.58213176229233
insert into t2 values (append("xxx", "yyy"), mul(4,3), e())|
insert into t2 values (append("a", "b"), mul(2,mul(3,4)), fun(1.7, 4, 6))|
select * from t2 where s = append("a", "b")|
s i d
-ab 24 1324.36598821719
+ab 24 1324.3659882171924
select * from t2 where i = mul(4,3) or i = mul(mul(3,4),2) order by i|
s i d
-xxxyyy 12 2.71828182845905
-ab 24 1324.36598821719
+xxxyyy 12 2.718281828459045
+ab 24 1324.3659882171924
select * from t2 where d = e()|
s i d
-xxxyyy 12 2.71828182845905
+xxxyyy 12 2.718281828459045
select * from t2 order by i|
s i d
-xxxyyy 12 2.71828182845905
-ab 24 1324.36598821719
+xxxyyy 12 2.718281828459045
+ab 24 1324.3659882171924
delete from t2|
drop function e|
drop function inc|
@@ -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 '',
@@ -3052,7 +3030,7 @@ set @x = @x + 1;
return @x;
end|
set @qcs1 = @@query_cache_size|
-set global query_cache_size = 100000|
+set global query_cache_size = 102400|
set @x = 1|
insert into t1 values ("qc", 42)|
select bug9902() from t1|
@@ -3343,9 +3321,43 @@ call bug11529()|
call bug11529()|
delete from t1|
drop procedure bug11529|
+set character set utf8|
drop procedure if exists bug6063|
drop procedure if exists bug7088_1|
drop procedure if exists bug7088_2|
+create procedure bug6063()
+begin
+lâbel: begin end;
+label: begin end;
+label1: begin end;
+end|
+create procedure bug7088_1()
+label1: begin end label1|
+create procedure bug7088_2()
+lÀbel1: begin end|
+call bug6063()|
+call bug7088_1()|
+call bug7088_2()|
+set character set default|
+show create procedure bug6063|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+bug6063 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug6063`()
+begin
+lâbel: begin end;
+label: begin end;
+label1: begin end;
+end utf8 latin1_swedish_ci latin1_swedish_ci
+show create procedure bug7088_1|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+bug7088_1 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug7088_1`()
+label1: begin end label1 utf8 latin1_swedish_ci latin1_swedish_ci
+show create procedure bug7088_2|
+Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
+bug7088_2 CREATE DEFINER=`root`@`localhost` PROCEDURE `bug7088_2`()
+läbel1: begin end utf8 latin1_swedish_ci latin1_swedish_ci
+drop procedure bug6063|
+drop procedure bug7088_1|
+drop procedure bug7088_2|
drop procedure if exists bug9565_sub|
drop procedure if exists bug9565|
create procedure bug9565_sub()
@@ -3736,9 +3748,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` (
@@ -4296,19 +4305,10 @@ drop procedure if exists bug13012|
create procedure bug13012()
BEGIN
REPAIR TABLE t1;
-BACKUP TABLE t1 to '<MYSQLTEST_VARDIR>/tmp/';
-DROP TABLE t1;
-RESTORE TABLE t1 FROM '<MYSQLTEST_VARDIR>/tmp/';
END|
call bug13012()|
Table Op Msg_type Msg_text
test.t1 repair status OK
-Table Op Msg_type Msg_text
-test.t1 backup Warning The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
-test.t1 backup status OK
-Table Op Msg_type Msg_text
-test.t1 restore Warning The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 6.0. Please use MySQL Administrator (mysqldump, mysql) instead
-test.t1 restore status OK
drop procedure bug13012|
create view v1 as select * from t1|
create procedure bug13012()
@@ -4990,22 +4990,22 @@ SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"|
dtd_identifier
-char(10) CHARSET utf8
+char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f2"|
dtd_identifier
-char(10) CHARSET koi8r
+char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f3"|
dtd_identifier
-char(10) CHARSET utf8
+char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f4"|
dtd_identifier
-char(10) CHARSET koi8r
+char(10)
SELECT CHARSET(bug16211_f1())|
CHARSET(bug16211_f1())
utf8
@@ -5040,22 +5040,22 @@ SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f1"|
dtd_identifier
-char(10) CHARSET utf8
+char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest1" AND ROUTINE_NAME = "bug16211_f2"|
dtd_identifier
-char(10) CHARSET koi8r
+char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f3"|
dtd_identifier
-char(10) CHARSET utf8
+char(10)
SELECT dtd_identifier
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = "mysqltest2" AND ROUTINE_NAME = "bug16211_f4"|
dtd_identifier
-char(10) CHARSET koi8r
+char(10)
SELECT CHARSET(bug16211_f1())|
CHARSET(bug16211_f1())
utf8
@@ -5972,9 +5972,9 @@ CREATE TABLE t3 (f1 INT, f2 FLOAT)|
INSERT INTO t3 VALUES (1, 3.4), (1, 2), (1, 0.9), (2, 8), (2, 7)|
SELECT SUM(f2), bug25373(f1) FROM t3 GROUP BY bug25373(f1) WITH ROLLUP|
SUM(f2) bug25373(f1)
-6.30000007152557 1
+6.300000071525574 1
15 2
-21.3000000715256 NULL
+21.300000071525574 NULL
DROP FUNCTION bug25373|
DROP TABLE t3|
DROP DATABASE IF EXISTS mysqltest1|
@@ -6106,35 +6106,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 +6200,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 +6222,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;
@@ -6934,15 +6903,12 @@ DROP FUNCTION f1;
drop procedure if exists p;
set @old_mode= @@sql_mode;
-set @@sql_mode= pow(2,32)-1;
+set @@sql_mode= cast(pow(2,32)-1 as unsigned integer);
select @@sql_mode into @full_mode;
create procedure p() begin end;
call p();
-select @@sql_mode;
-@@sql_mode
-REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,?,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,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,HIGH_NOT_PRECEDENCE,NO_ENGINE_SUBSTITUTION,PAD_CHAR_TO_FULL_LENGTH
set @@sql_mode= @old_mode;
-select replace(@full_mode, '?', 'NOT_USED') into @full_mode;
+select replace(@full_mode, ',,,', ',NOT_USED,') into @full_mode;
select replace(@full_mode, 'ALLOW_INVALID_DATES', 'INVALID_DATES') into @full_mode;
select name from mysql.proc where name = 'p' and sql_mode = @full_mode;
name
@@ -7056,3 +7022,130 @@ 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;
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1(a INT, b CHAR)
+BEGIN
+IF a > 0 THEN
+CALL p1(a-1, 'ab');
+ELSE
+SELECT 1;
+END IF;
+END|
+SET @save_max_sp_recursion= @@max_sp_recursion_depth;
+SET @@max_sp_recursion_depth= 5;
+CALL p1(4, 'a');
+1
+1
+Warnings:
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
+SET @@max_sp_recursion_depth= @save_max_sp_recursion;
+DROP PROCEDURE p1;
+DROP PROCEDURE IF EXISTS p1;
+CREATE PROCEDURE p1(a CHAR)
+BEGIN
+SELECT 1;
+SELECT CAST('10 ' as UNSIGNED INTEGER);
+SELECT 1;
+END|
+CALL p1('data truncated parameter');
+1
+1
+CAST('10 ' as UNSIGNED INTEGER)
+10
+1
+1
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1292 Truncated incorrect INTEGER value: '10 '
+DROP PROCEDURE p1;
+DROP PROCEDURE IF EXISTS p1;
+DROP PROCEDURE IF EXISTS p2;
+DROP PROCEDURE IF EXISTS p3;
+DROP PROCEDURE IF EXISTS p4;
+CREATE PROCEDURE p1()
+CALL p2()|
+CREATE PROCEDURE p2()
+CALL p3()|
+CREATE PROCEDURE p3()
+CALL p4()|
+CREATE PROCEDURE p4()
+BEGIN
+SELECT 1;
+SELECT CAST('10 ' as UNSIGNED INTEGER);
+SELECT 2;
+END|
+CALL p1();
+1
+1
+CAST('10 ' as UNSIGNED INTEGER)
+10
+2
+2
+Warnings:
+Warning 1292 Truncated incorrect INTEGER value: '10 '
+DROP PROCEDURE p1;
+DROP PROCEDURE p2;
+DROP PROCEDURE p3;
+DROP PROCEDURE p4;
+DROP FUNCTION IF EXISTS f1;
+DROP FUNCTION IF EXISTS f2;
+DROP FUNCTION IF EXISTS f3;
+DROP FUNCTION IF EXISTS f4;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a CHAR(2));
+INSERT INTO t1 VALUES ('aa');
+CREATE FUNCTION f1() RETURNS CHAR
+RETURN (SELECT f2())|
+CREATE FUNCTION f2() RETURNS CHAR
+RETURN (SELECT f3())|
+CREATE FUNCTION f3() RETURNS CHAR
+RETURN (SELECT f4())|
+CREATE FUNCTION f4() RETURNS CHAR
+BEGIN
+RETURN (SELECT a FROM t1);
+END|
+SELECT f1();
+f1()
+a
+Warnings:
+Warning 1265 Data truncated for column 'f4()' at row 1
+DROP FUNCTION f1;
+DROP FUNCTION f2;
+DROP FUNCTION f3;
+DROP FUNCTION f4;
+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..f55e535a293 100644
--- a/mysql-test/r/sp_trans.result
+++ b/mysql-test/r/sp_trans.result
@@ -533,9 +533,7 @@ set @@session.max_heap_table_size=default|
CREATE DATABASE db_bug7787|
use db_bug7787|
CREATE PROCEDURE p1()
-SHOW INNODB STATUS; |
-Warnings:
-Warning 1287 The syntax 'SHOW INNODB STATUS' is deprecated and will be removed in MySQL 6.0. Please use 'SHOW ENGINE INNODB STATUS' instead
+SHOW ENGINE INNODB STATUS; |
GRANT EXECUTE ON PROCEDURE p1 TO user_bug7787@localhost|
DROP DATABASE db_bug7787|
drop user user_bug7787@localhost|
@@ -556,3 +554,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/status.result b/mysql-test/r/status.result
index ce3acba9b8a..c0cd0f7bc1a 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -238,5 +238,11 @@ SELECT 9;
9
DROP PROCEDURE p1;
DROP FUNCTION f1;
+DROP VIEW IF EXISTS v1;
+CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS;
+SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
+SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
+NAME
+DROP VIEW v1;
set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result
index 241f4198bf7..bdb7576f95e 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
@@ -873,14 +873,14 @@ Warning 1264 Out of range value for column 'col2' at row 1
SELECT * FROM t1;
col1 col2
-1.1e-37 0
-3.4e+38 3.4e+38
+3.4e38 3.4e38
-1.1e-37 0
-3.4e+38 3.4e+38
+3.4e38 3.4e38
0 NULL
2 NULL
NULL NULL
-3.40282e+38 0
-3.40282e+38 0
+3.40282e38 0
+3.40282e38 0
DROP TABLE t1;
CREATE TABLE t1 (col1 DOUBLE PRECISION, col2 DOUBLE PRECISION UNSIGNED);
INSERT INTO t1 VALUES (-2.2E-307,0),(2E-307,0),(+1.7E+308,+1.7E+308);
@@ -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');
@@ -922,14 +922,14 @@ SELECT * FROM t1;
col1 col2
-2.2e-307 0
1e-303 0
-NULL 1.7e+308
+NULL 1.7e308
-2.2e-307 0
-2e-307 0
-NULL 1.7e+308
+NULL 1.7e308
0 NULL
2 NULL
NULL NULL
-1.79769313486232e+308 0
+1.7976931348623157e308 0
DROP TABLE t1;
CREATE TABLE t1 (col1 CHAR(5), col2 VARCHAR(6));
INSERT INTO t1 VALUES ('hello', 'hello'),('he', 'he'),('hello ', 'hello ');
@@ -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 dc3cff68731..cd7af9651b9 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));
@@ -735,7 +735,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1249 Select 3 was reduced during optimization
Note 1249 Select 2 was reduced during optimization
-Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = (1 + 1))
+Note 1003 select `test`.`t2`.`id` AS `id` from `test`.`t2` where (`test`.`t2`.`id` = <cache>((1 + 1)))
EXPLAIN EXTENDED SELECT * FROM t2 WHERE id IN (SELECT 1 UNION SELECT 3);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY t2 index NULL id 5 NULL 2 100.00 Using where; Using index
@@ -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');
@@ -3562,9 +3562,7 @@ SELECT sql_no_cache * FROM t1 WHERE NOT EXISTS
(SELECT i FROM t1) UNION
(SELECT i FROM t1)
);
-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 'UNION
-(SELECT i FROM t1)
-)' at line 3
+i
SELECT * FROM t1
WHERE NOT EXISTS (((SELECT i FROM t1) UNION (SELECT i FROM t1)));
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 'UNION (SELECT i FROM t1)))' at line 2
@@ -3574,7 +3572,11 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
from t1' at line 1
explain select * from t1 where not exists
((select t11.i from t1 t11) union (select t12.i from t1 t12));
-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 'union (select t12.i from t1 t12))' at line 2
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+3 UNION NULL NULL NULL NULL NULL NULL NULL no matching row in const table
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(250), b INT auto_increment, PRIMARY KEY (b));
insert into t1 (a) values (FLOOR(rand() * 100));
@@ -3667,8 +3669,6 @@ CREATE TABLE t1 (a int, b int auto_increment, PRIMARY KEY (b));
CREATE TABLE t2 (x int auto_increment, y int, z int,
PRIMARY KEY (x), FOREIGN KEY (y) REFERENCES t1 (b));
SET SESSION sort_buffer_size = 32 * 1024;
-Warnings:
-Warning 1292 Truncated incorrect sort_buffer_size value: '32768'
SELECT SQL_NO_CACHE COUNT(*)
FROM (SELECT a, b, (SELECT x FROM t2 WHERE y=b ORDER BY z DESC LIMIT 1) c
FROM t1) t;
@@ -4279,8 +4279,15 @@ Note 1003 select 2 AS `2` from `test`.`t1` where exists(select 1 AS `1` from `te
EXPLAIN EXTENDED
SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION
(SELECT 1 FROM t2 WHERE t1.a = t2.a));
-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 'UNION
-(SELECT 1 FROM t2 WHERE t1.a = t2.a))' at line 2
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL
+Warnings:
+Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 'test.t1.a' of SELECT #3 was resolved in SELECT #1
+Note 1003 select 2 AS `2` from `test`.`t1` where exists((select 1 AS `1` from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)) union (select 1 AS `1` from `test`.`t2` where (`test`.`t1`.`a` = `test`.`t2`.`a`)))
DROP TABLE t1,t2;
create table t1(f11 int, f12 int);
create table t2(f21 int unsigned not null, f22 int, f23 varchar(10));
@@ -4588,6 +4595,270 @@ id g v s
51 50 NULL l
61 60 NULL l
drop table t1, t2;
+#
+# Bug#33204: INTO is allowed in subselect, causing inconsistent results
+#
+CREATE TABLE t1( a INT );
+INSERT INTO t1 VALUES (1),(2);
+CREATE TABLE t2( a INT, b INT );
+SELECT *
+FROM (SELECT a INTO @var FROM t1 WHERE a = 2) t1a;
+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 'INTO @var FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a;
+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 'INTO OUTFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT *
+FROM (SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a;
+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 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2) t1a' at line 2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO @var FROM t1 WHERE a = 2
+) t1a;
+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 'INTO @var FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+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 'INTO OUTFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a;
+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 'INTO DUMPFILE 'file' FROM t1 WHERE a = 2
+) t1a' at line 4
+SELECT * FROM (SELECT a FROM t1 WHERE a = 2) t1a;
+a
+2
+SELECT * FROM (
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+2
+SELECT * FROM (
+SELECT 1 a
+UNION
+SELECT a FROM t1 WHERE a = 2
+UNION
+SELECT a FROM t1 WHERE a = 2
+) t1a;
+a
+1
+2
+SELECT * FROM ((SELECT 1 a) UNION SELECT 1 a);
+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 ')' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a)) alias;
+a
+1
+SELECT * FROM (SELECT 1 UNION SELECT 1) t1a;
+1
+1
+SELECT * FROM ((SELECT 1 a INTO @a)) t1a;
+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 'INTO @a)) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO OUTFILE 'file' )) t1a;
+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 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM ((SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+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 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO @a)) t1a;
+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 'INTO @a)) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO DUMPFILE 'file' )) t1a;
+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 'INTO DUMPFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION (SELECT 1 a INTO OUTFILE 'file' )) t1a;
+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 'INTO OUTFILE 'file' )) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO @a))) t1a;
+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 'INTO @a))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO DUMPFILE 'file' ))) t1a;
+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 'INTO DUMPFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a UNION ((SELECT 1 a INTO OUTFILE 'file' ))) t1a;
+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 'INTO OUTFILE 'file' ))) t1a' at line 1
+SELECT * FROM (SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a LIMIT 1) t1a;
+a
+1
+SELECT * FROM (SELECT 1 a UNION SELECT 1 a ORDER BY a LIMIT 1) t1a;
+a
+1
+SELECT * FROM t1 JOIN (SELECT 1 UNION SELECT 1) alias ON 1;
+a 1
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 UNION SELECT 1)) ON 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 ')) ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a UNION SELECT 1) ON 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 'ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a UNION SELECT 1)) ON 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 ') ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) t1a ON 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 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN ((t1 t1a)) t1a ON 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 't1a ON 1' at line 1
+SELECT * FROM t1 JOIN (t1 t1a) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM t1 JOIN ((t1 t1a)) ON 1;
+a a
+1 1
+2 1
+1 2
+2 2
+SELECT * FROM (t1 t1a);
+a
+1
+2
+SELECT * FROM ((t1 t1a));
+a
+1
+2
+SELECT * FROM t1 JOIN (SELECT 1 t1a) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 t1a)) alias ON 1;
+a t1a
+1 1
+2 1
+SELECT * FROM t1 JOIN (SELECT 1 a) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM t1 JOIN ((SELECT 1 a)) a ON 1;
+a a
+1 1
+2 1
+SELECT * FROM (t1 JOIN (SELECT 1) t1a1 ON 1) t1a2;
+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 't1a2' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 3 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO @a);
+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 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+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 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+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 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO @a);
+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 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO OUTFILE 'file' );
+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 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 INTO DUMPFILE 'file' );
+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 'INTO DUMPFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO @a);
+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 'INTO @a)' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+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 'INTO OUTFILE 'file' )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+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 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO @v );
+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 'INTO @v )' at line 1
+SELECT ( SELECT 1 INTO OUTFILE 'file' );
+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 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 INTO DUMPFILE 'file' );
+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 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO @v );
+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 'INTO @v )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO OUTFILE 'file' );
+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 'INTO OUTFILE 'file' )' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 INTO DUMPFILE 'file' );
+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 'INTO DUMPFILE 'file' )' at line 1
+SELECT ( SELECT a FROM t1 WHERE a = 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 ) a
+1 1
+1 2
+SELECT ( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ), a FROM t1;
+( SELECT a FROM t1 WHERE a = 1 UNION SELECT 1 ) a
+1 1
+1 2
+SELECT * FROM t2 WHERE (a, b) IN (SELECT a, b FROM t2);
+a b
+SELECT 1 UNION ( SELECT 1 UNION SELECT 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 'UNION SELECT 1 )' at line 1
+( SELECT 1 UNION SELECT 1 ) UNION SELECT 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 'UNION SELECT 1 ) UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION ( SELECT 1 UNION SELECT 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 'UNION SELECT 1 ) )' at line 1
+SELECT ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 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 'UNION SELECT 1' at line 1
+SELECT ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+( SELECT 1 UNION SELECT 1 UNION SELECT 1 )
+1
+SELECT ((SELECT 1 UNION SELECT 1 UNION SELECT 1));
+((SELECT 1 UNION SELECT 1 UNION SELECT 1))
+1
+SELECT * FROM ( SELECT 1 UNION ( SELECT 1 UNION SELECT 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 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 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 ') UNION SELECT 1 )' at line 1
+SELECT * FROM ( SELECT 1 UNION SELECT 1 UNION SELECT 1 ) a;
+1
+1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION ( SELECT 1 UNION SELECT 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 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION ( SELECT 1 UNION SELECT 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 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION ( SELECT 1 UNION SELECT 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 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION ( SELECT 1 UNION SELECT 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 'UNION SELECT 1 ) )' at line 1
+SELECT * FROM t1 WHERE a = ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 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 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ALL ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 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 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ANY ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 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 'UNION SELECT 1 ) UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a IN ( ( SELECT 1 UNION SELECT 1 ) UNION SELECT 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 'UNION SELECT 1 )' at line 1
+SELECT * FROM t1 WHERE a = ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ALL ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a = ANY ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 UNION SELECT 1 );
+a
+1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 UNION SELECT 1 INTO @v );
+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 'INTO @v )' at line 1
+SELECT EXISTS(SELECT 1+1);
+EXISTS(SELECT 1+1)
+1
+SELECT EXISTS(SELECT 1+1 INTO @test);
+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 'INTO @test)' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 UNION SELECT 1 INTO @v );
+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 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE EXISTS ( SELECT 1 INTO @v );
+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 'INTO @v )' at line 1
+SELECT * FROM t1 WHERE a IN ( SELECT 1 INTO @v );
+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 'INTO @v )' at line 1
+DROP TABLE t1, t2;
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result
index d5fb1a7bbde..a51cef6833d 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;
@@ -964,3 +964,53 @@ Variable_name Value
Handler_read_rnd_next 18
DROP TABLE t1,t2;
End of 5.1 tests
+#
+# BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery
+# in the select list
+#
+
+CREATE TABLE t1 (
+i int(11) DEFAULT NULL,
+v varchar(1) DEFAULT NULL
+);
+
+INSERT INTO t1 VALUES (8,'v');
+INSERT INTO t1 VALUES (9,'r');
+INSERT INTO t1 VALUES (NULL,'y');
+
+CREATE TABLE t2 (
+i int(11) DEFAULT NULL,
+v varchar(1) DEFAULT NULL,
+KEY i_key (i)
+);
+
+INSERT INTO t2 VALUES (NULL,'r');
+INSERT INTO t2 VALUES (0,'c');
+INSERT INTO t2 VALUES (0,'o');
+INSERT INTO t2 VALUES (2,'v');
+INSERT INTO t2 VALUES (7,'c');
+
+SELECT i, v, (SELECT COUNT(DISTINCT i)
+FROM t1
+WHERE v = t2.v) as subsel
+FROM t2;
+i v subsel
+NULL r 1
+0 c 0
+0 o 0
+2 v 1
+7 c 0
+
+EXPLAIN EXTENDED
+SELECT i, v, (SELECT COUNT(DISTINCT i)
+FROM t1
+WHERE v = t2.v) as subsel
+FROM t2;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00
+2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1276 Field or reference 'test.t2.v' of SELECT #2 was resolved in SELECT #1
+Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,(select count(distinct `test`.`t1`.`i`) AS `COUNT(DISTINCT i)` from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`)) AS `subsel` from `test`.`t2`
+DROP TABLE t1,t2;
+End of 5.6 tests
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..d1f1ec87efd 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -26,13 +26,11 @@ SELECT trigger_name, definer FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_n
trigger_name definer
wl2818_trg1
wl2818_trg2 mysqltest_dfn@localhost
-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.
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..47b50b233b3 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,77 @@ 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;
+DROP TRIGGER IF EXISTS trg1;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE a CHAR;
+SELECT 'ab' INTO a;
+SELECT 'ab' INTO a;
+SELECT 'a' INTO a;
+END|
+INSERT INTO t1 VALUES (1);
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+DROP TRIGGER trg1;
+DROP TABLE t1;
+DROP TRIGGER IF EXISTS trg1;
+DROP TRIGGER IF EXISTS trg2;
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (a INT);
+CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE trg1 CHAR;
+SELECT 'ab' INTO trg1;
+END|
+CREATE TRIGGER trg2 AFTER INSERT ON t1 FOR EACH ROW
+BEGIN
+DECLARE trg2 CHAR;
+SELECT 'ab' INTO trg2;
+END|
+INSERT INTO t1 VALUES (0);
+Warnings:
+Warning 1265 Data truncated for column 'trg1' at row 1
+Warning 1265 Data truncated for column 'trg2' at row 1
+SELECT * FROM t1;
+a
+0
+SHOW WARNINGS;
+Level Code Message
+INSERT INTO t1 VALUES (1),(2);
+Warnings:
+Warning 1265 Data truncated for column 'trg1' at row 1
+Warning 1265 Data truncated for column 'trg2' at row 1
+Warning 1265 Data truncated for column 'trg1' at row 1
+Warning 1265 Data truncated for column 'trg2' at row 1
+DROP TRIGGER trg1;
+DROP TRIGGER trg2;
+DROP TABLE t1;
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result
index d66308a9bd7..982966f6689 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;
@@ -165,16 +165,14 @@ trg2 @
trg3 @abc@def@@
trg4 @hostname
trg5 @abcdef@@@hostname
-Warnings:
-Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
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 +469,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_blob.result b/mysql-test/r/type_blob.result
index d11ab236c34..78f31286ea7 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -889,28 +889,12 @@ CREATE TABLE b15776 (a year(0));
DROP TABLE b15776;
CREATE TABLE b15776 (a year(-2));
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 '-2))' at line 1
-CREATE TABLE b15776 (a timestamp(4294967294));
-Warnings:
-Warning 1287 The syntax 'TIMESTAMP(4294967294)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-DROP TABLE b15776;
-CREATE TABLE b15776 (a timestamp(4294967295));
-Warnings:
-Warning 1287 The syntax 'TIMESTAMP(4294967295)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-DROP TABLE b15776;
-CREATE TABLE b15776 (a timestamp(4294967296));
-ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
-CREATE TABLE b15776 (a timestamp(-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
-CREATE TABLE b15776 (a timestamp(-2));
-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 '-2))' at line 1
CREATE TABLE b15776 (a int(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
CREATE TABLE b15776 (a char(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
CREATE TABLE b15776 (a year(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
-CREATE TABLE b15776 (a timestamp(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
-ERROR 42000: Display width out of range for column 'a' (max = 4294967295)
CREATE TABLE b15776 select cast(null as char(4294967295));
show columns from b15776;
Field Type Null Key Default Extra
@@ -974,3 +958,21 @@ ERROR 42000: Display width out of range for column 'cast as char' (max = 4294967
explain select convert(1, binary(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999));
ERROR 42000: Display width out of range for column 'cast as char' (max = 4294967295)
End of 5.0 tests
+CREATE TABLE t1(id INT NOT NULL);
+CREATE TABLE t2(id INT NOT NULL, c TEXT NOT NULL);
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (1, '');
+UPDATE t2 SET c = REPEAT('1', 70000);
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+SELECT LENGTH(c) FROM t2;
+LENGTH(c)
+65535
+UPDATE t1 LEFT JOIN t2 USING(id) SET t2.c = REPEAT('1', 70000) WHERE t1.id = 1;
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+SELECT LENGTH(c) FROM t2;
+LENGTH(c)
+65535
+DROP TABLE t1, t2;
+End of 5.1 tests
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..d131fa2b4d5 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));
@@ -796,6 +796,18 @@ SELECT ROUND(qty,3), dps, ROUND(qty,dps) FROM t1;
ROUND(qty,3) dps ROUND(qty,dps)
1.133 3 1.133000
DROP TABLE t1;
+create table t1 (c1 decimal(10,6));
+insert into t1 (c1) values (9.99e-4);
+insert into t1 (c1) values (9.98e-4);
+insert into t1 (c1) values (0.000999);
+insert into t1 (c1) values (cast(9.99e-4 as decimal(10,6)));
+select * from t1;
+c1
+0.000999
+0.000998
+0.000999
+0.000999
+drop table t1;
SELECT 1 % .123456789123456789123456789123456789123456789123456789123456789123456789123456789 AS '%';
%
0.012345687012345687012345687012345687012345687012345687012345687012345687000000000
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index a3a13bb0435..546e281ee67 100644
--- a/mysql-test/r/type_float.result
+++ b/mysql-test/r/type_float.result
@@ -2,9 +2,9 @@ drop table if exists t1,t2;
SELECT 10,10.0,10.,.1e+2,100.0e-1;
10 10.0 10. .1e+2 100.0e-1
10 10.0 10 10 10
-SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000;
-6e-05 -6e-05 --6e-05 -6e-05+1.000000
-6e-05 -6e-05 6e-05 0.99994
+SELECT 6e-16, -6e-16, --6e-16, -6e-16+1.000000;
+6e-16 -6e-16 --6e-16 -6e-16+1.000000
+6e-16 -6e-16 6e-16 0.9999999999999994
SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1;
1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1
10 10 10 10 10 10 0.1 0.1 0.1
@@ -31,16 +31,16 @@ select * from t1;
f1 f2
10 10
100000 100000
-1.23457e+09 1234567890
-1e+10 10000000000
-1e+15 1e+15
-1e+20 1e+20
-3.40282e+38 1e+50
-3.40282e+38 1e+150
+1234570000 1234567890
+10000000000 10000000000
+1e15 1e15
+1e20 1e20
+3.40282e38 1e50
+3.40282e38 1e150
-10 -10
-1e-05 1e-05
-1e-10 1e-10
-1e-15 1e-15
+0.00001 0.00001
+0.0000000001 0.0000000001
+0.000000000000001 0.000000000000001
1e-20 1e-20
0 1e-50
0 1e-150
@@ -87,7 +87,7 @@ col
create table t2 select c1 + c1 * (c2 / 100) as col1, round(c1, 5) as col2, round(c1, 35) as col3, sqrt(c1*1e-15) col4 from t1;
select * from t2;
col1 col2 col3 col4
-140.36 121.00000 121 3.47850542618522e-07
+140.36 121.00000 121 0.00000034785054261852176
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -201,9 +201,9 @@ insert into t1 values (2e5),(2e6),(2e-4),(2e-5);
select * from t1;
c
200000
-2e+06
+2e6
0.0002
-2e-05
+2e-5
drop table t1;
CREATE TABLE t1 (
reckey int unsigned NOT NULL,
@@ -267,7 +267,7 @@ select 1e-308, 1.00000001e-300, 100000000e-300;
1e-308 1.00000001e-300 1e-292
select 10e307;
10e307
-1e+308
+1e308
create table t1(a int, b double(8, 2));
insert into t1 values
(1, 28.50), (1, 121.85), (1, 157.23), (1, 1351.00), (1, -1965.35), (1, 81.75),
@@ -369,12 +369,12 @@ Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 2
select f1 + 0e0 from t1;
f1 + 0e0
-1e+199
--1e+199
-1e+200
--1e+200
-1e+200
--1e+200
+1e199
+-1e199
+1e200
+-1e200
+1e200
+-1e200
drop table t1;
create table t1 (f1 float(30, 0));
insert into t1 values (1e29), (-1e29);
@@ -385,12 +385,36 @@ Warning 1264 Out of range value for column 'f1' at row 1
Warning 1264 Out of range value for column 'f1' at row 2
select f1 + 0e0 from t1;
f1 + 0e0
-1.00000001504747e+29
--1.00000001504747e+29
-1.00000001504747e+30
--1.00000001504747e+30
-1.00000001504747e+30
--1.00000001504747e+30
+1.0000000150474662e29
+-1.0000000150474662e29
+1.0000000150474662e30
+-1.0000000150474662e30
+1.0000000150474662e30
+-1.0000000150474662e30
+drop table t1;
+create table t1 (c char(6));
+insert into t1 values (2e6),(2e-5);
+select * from t1;
+c
+2e6
+2e-5
+drop table t1;
+CREATE TABLE d1 (d DOUBLE);
+INSERT INTO d1 VALUES (1.7976931348623157E+308);
+SELECT * FROM d1;
+d
+1.7976931348623157e308
+INSERT INTO d1 VALUES (1.79769313486232e+308);
+ERROR 22007: Illegal double '1.79769313486232e+308' value found during parsing
+SELECT * FROM d1;
+d
+1.7976931348623157e308
+DROP TABLE d1;
+create table t1 (a char(20));
+insert into t1 values (1.225e-05);
+select a+0 from t1;
+a+0
+0.00001225
drop table t1;
create table t1(d double, u bigint unsigned);
insert into t1(d) values (9.22337203685479e18),
@@ -405,6 +429,6 @@ CREATE TABLE t1 (f1 DOUBLE);
INSERT INTO t1 VALUES(-1.79769313486231e+308);
SELECT f1 FROM t1;
f1
--1.79769313486231e+308
+-1.79769313486231e308
DROP TABLE t1;
End of 5.0 tests
diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result
index 70ee3a56cf3..00526597a32 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
@@ -917,7 +917,7 @@ cast('1.00000001335143196001808973960578441619873046875E-10' as decimal(30,15))
0.000000000100000
select ln(14000) c1, convert(ln(14000),decimal(5,3)) c2, cast(ln(14000) as decimal(5,3)) c3;
c1 c2 c3
-9.5468126085974 9.547 9.547
+9.546812608597396 9.547 9.547
select convert(ln(14000),decimal(2,3)) c1;
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '').
select cast(ln(14000) as decimal(2,3)) c1;
@@ -1141,17 +1141,17 @@ my_float my_double my_varchar
1.17549e-18 1.175494345e-18 1.175494345e-18
1.17549e-17 1.175494345e-17 1.175494345e-17
1.17549e-16 1.175494345e-16 1.175494345e-16
-1.17549e-15 1.175494345e-15 1.175494345e-15
-1.17549e-14 1.175494345e-14 1.175494345e-14
-1.17549e-13 1.175494345e-13 1.175494345e-13
-1.17549e-12 1.175494345e-12 1.175494345e-12
-1.17549e-11 1.175494345e-11 1.175494345e-11
-1.17549e-10 1.175494345e-10 1.175494345e-10
-1.17549e-09 1.175494345e-09 1.175494345e-9
-1.17549e-08 1.175494345e-08 1.175494345e-8
-1.17549e-07 1.175494345e-07 1.175494345e-7
-1.17549e-06 1.175494345e-06 1.175494345e-6
-1.17549e-05 1.175494345e-05 1.175494345e-5
+0.00000000000000117549 0.000000000000001175494345 1.175494345e-15
+0.0000000000000117549 0.00000000000001175494345 1.175494345e-14
+0.000000000000117549 0.0000000000001175494345 1.175494345e-13
+0.00000000000117549 0.000000000001175494345 1.175494345e-12
+0.0000000000117549 0.00000000001175494345 1.175494345e-11
+0.000000000117549 0.0000000001175494345 1.175494345e-10
+0.00000000117549 0.000000001175494345 1.175494345e-9
+0.0000000117549 0.00000001175494345 1.175494345e-8
+0.000000117549 0.0000001175494345 1.175494345e-7
+0.00000117549 0.000001175494345 1.175494345e-6
+0.0000117549 0.00001175494345 1.175494345e-5
0.000117549 0.0001175494345 1.175494345e-4
0.00117549 0.001175494345 1.175494345e-3
0.0117549 0.01175494345 1.175494345e-2
@@ -1175,21 +1175,21 @@ CAST(my_float AS DECIMAL(65,30)) my_float
0.000000000000000001175494374380 1.17549e-18
0.000000000000000011754943743802 1.17549e-17
0.000000000000000117549432474939 1.17549e-16
-0.000000000000001175494324749389 1.17549e-15
-0.000000000000011754943671010360 1.17549e-14
-0.000000000000117549429933840000 1.17549e-13
-0.000000000001175494380653563000 1.17549e-12
-0.000000000011754943372854760000 1.17549e-11
-0.000000000117549428524377200000 1.17549e-10
-0.000000001175494368510499000000 1.17549e-09
-0.000000011754943685104990000000 1.17549e-08
-0.000000117549433298336200000000 1.17549e-07
-0.000001175494389826781000000000 1.17549e-06
-0.000011754943443520460000000000 1.17549e-05
+0.000000000000001175494324749389 0.00000000000000117549
+0.000000000000011754943671010362 0.0000000000000117549
+0.000000000000117549429933840040 0.000000000000117549
+0.000000000001175494380653563400 0.00000000000117549
+0.000000000011754943372854765000 0.0000000000117549
+0.000000000117549428524377220000 0.000000000117549
+0.000000001175494368510499000000 0.00000000117549
+0.000000011754943685104990000000 0.0000000117549
+0.000000117549433298336230000000 0.000000117549
+0.000001175494389826781100000000 0.00000117549
+0.000011754943443520460000000000 0.0000117549
0.000117549432616215200000000000 0.000117549
-0.001175494398921728000000000000 0.00117549
-0.011754943057894710000000000000 0.0117549
-0.117549434304237400000000000000 0.117549
+0.001175494398921728100000000000 0.00117549
+0.011754943057894707000000000000 0.0117549
+0.117549434304237370000000000000 0.117549
SELECT CAST(my_double AS DECIMAL(65,30)), my_double FROM t1;
CAST(my_double AS DECIMAL(65,30)) my_double
0.000000000000000000000000000000 1.175494345e-32
@@ -1209,17 +1209,17 @@ CAST(my_double AS DECIMAL(65,30)) my_double
0.000000000000000001175494345000 1.175494345e-18
0.000000000000000011754943450000 1.175494345e-17
0.000000000000000117549434500000 1.175494345e-16
-0.000000000000001175494345000000 1.175494345e-15
-0.000000000000011754943450000000 1.175494345e-14
-0.000000000000117549434500000000 1.175494345e-13
-0.000000000001175494345000000000 1.175494345e-12
-0.000000000011754943450000000000 1.175494345e-11
-0.000000000117549434500000000000 1.175494345e-10
-0.000000001175494345000000000000 1.175494345e-09
-0.000000011754943450000000000000 1.175494345e-08
-0.000000117549434500000000000000 1.175494345e-07
-0.000001175494345000000000000000 1.175494345e-06
-0.000011754943450000000000000000 1.175494345e-05
+0.000000000000001175494345000000 0.000000000000001175494345
+0.000000000000011754943450000000 0.00000000000001175494345
+0.000000000000117549434500000000 0.0000000000001175494345
+0.000000000001175494345000000000 0.000000000001175494345
+0.000000000011754943450000000000 0.00000000001175494345
+0.000000000117549434500000000000 0.0000000001175494345
+0.000000001175494345000000000000 0.000000001175494345
+0.000000011754943450000000000000 0.00000001175494345
+0.000000117549434500000000000000 0.0000001175494345
+0.000001175494345000000000000000 0.000001175494345
+0.000011754943450000000000000000 0.00001175494345
0.000117549434500000000000000000 0.0001175494345
0.001175494345000000000000000000 0.001175494345
0.011754943450000000000000000000 0.01175494345
@@ -1278,21 +1278,21 @@ my_decimal my_float
0.000000000000000001175494374380 1.17549e-18
0.000000000000000011754943743802 1.17549e-17
0.000000000000000117549432474939 1.17549e-16
-0.000000000000001175494324749389 1.17549e-15
-0.000000000000011754943671010360 1.17549e-14
-0.000000000000117549429933840000 1.17549e-13
-0.000000000001175494380653563000 1.17549e-12
-0.000000000011754943372854760000 1.17549e-11
-0.000000000117549428524377200000 1.17549e-10
-0.000000001175494368510499000000 1.17549e-09
-0.000000011754943685104990000000 1.17549e-08
-0.000000117549433298336200000000 1.17549e-07
-0.000001175494389826781000000000 1.17549e-06
-0.000011754943443520460000000000 1.17549e-05
+0.000000000000001175494324749389 0.00000000000000117549
+0.000000000000011754943671010362 0.0000000000000117549
+0.000000000000117549429933840040 0.000000000000117549
+0.000000000001175494380653563400 0.00000000000117549
+0.000000000011754943372854765000 0.0000000000117549
+0.000000000117549428524377220000 0.000000000117549
+0.000000001175494368510499000000 0.00000000117549
+0.000000011754943685104990000000 0.0000000117549
+0.000000117549433298336230000000 0.000000117549
+0.000001175494389826781100000000 0.00000117549
+0.000011754943443520460000000000 0.0000117549
0.000117549432616215200000000000 0.000117549
-0.001175494398921728000000000000 0.00117549
-0.011754943057894710000000000000 0.0117549
-0.117549434304237400000000000000 0.117549
+0.001175494398921728100000000000 0.00117549
+0.011754943057894707000000000000 0.0117549
+0.117549434304237370000000000000 0.117549
UPDATE t1 SET my_decimal = my_double;
SELECT my_decimal, my_double FROM t1;
my_decimal my_double
@@ -1313,17 +1313,17 @@ my_decimal my_double
0.000000000000000001175494345000 1.175494345e-18
0.000000000000000011754943450000 1.175494345e-17
0.000000000000000117549434500000 1.175494345e-16
-0.000000000000001175494345000000 1.175494345e-15
-0.000000000000011754943450000000 1.175494345e-14
-0.000000000000117549434500000000 1.175494345e-13
-0.000000000001175494345000000000 1.175494345e-12
-0.000000000011754943450000000000 1.175494345e-11
-0.000000000117549434500000000000 1.175494345e-10
-0.000000001175494345000000000000 1.175494345e-09
-0.000000011754943450000000000000 1.175494345e-08
-0.000000117549434500000000000000 1.175494345e-07
-0.000001175494345000000000000000 1.175494345e-06
-0.000011754943450000000000000000 1.175494345e-05
+0.000000000000001175494345000000 0.000000000000001175494345
+0.000000000000011754943450000000 0.00000000000001175494345
+0.000000000000117549434500000000 0.0000000000001175494345
+0.000000000001175494345000000000 0.000000000001175494345
+0.000000000011754943450000000000 0.00000000001175494345
+0.000000000117549434500000000000 0.0000000001175494345
+0.000000001175494345000000000000 0.000000001175494345
+0.000000011754943450000000000000 0.00000001175494345
+0.000000117549434500000000000000 0.0000001175494345
+0.000001175494345000000000000000 0.000001175494345
+0.000011754943450000000000000000 0.00001175494345
0.000117549434500000000000000000 0.0001175494345
0.001175494345000000000000000000 0.001175494345
0.011754943450000000000000000000 0.01175494345
@@ -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_ranges.result b/mysql-test/r/type_ranges.result
index 6e08067d8a4..5e915fbfa2d 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -276,8 +276,8 @@ t1 int(1) NULL NO 0 #
t2 varchar(1) latin1_swedish_ci NO #
t3 varchar(256) latin1_swedish_ci NO #
t4 varbinary(256) NULL NO #
-t5 longtext latin1_swedish_ci NO NULL #
-t6 longblob NULL NO NULL #
+t5 text latin1_swedish_ci NO NULL #
+t6 blob NULL NO NULL #
t7 char(0) latin1_swedish_ci NO #
t8 binary(0) NULL NO #
select t1,t2,length(t3),length(t4),length(t5),length(t6),t7,t8 from t2;
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index e4b90196c2d..a5880f2b452 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -85,6 +85,7 @@ sec_to_time(time_to_sec(t))
13:00:00
09:00:00
drop table t1;
+End of 4.1 tests
select cast('100:55:50' as time) < cast('24:00:00' as time);
cast('100:55:50' as time) < cast('24:00:00' as time)
0
@@ -138,3 +139,27 @@ CAST(c AS TIME)
00:00:00
DROP TABLE t1;
End of 5.0 tests
+CREATE TABLE t1 (f1 TIME);
+INSERT INTO t1 VALUES ('24:00:00');
+SELECT '24:00:00' = (SELECT f1 FROM t1);
+'24:00:00' = (SELECT f1 FROM t1)
+1
+SELECT CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1)
+1
+SELECT CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1)
+0
+TRUNCATE t1;
+INSERT INTO t1 VALUES ('-24:00:00');
+SELECT CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('24:00:00' AS TIME) = (SELECT f1 FROM t1)
+0
+SELECT CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1);
+CAST('-24:00:00' AS TIME) = (SELECT f1 FROM t1)
+1
+SELECT '-24:00:00' = (SELECT f1 FROM t1);
+'-24:00:00' = (SELECT f1 FROM t1)
+1
+DROP TABLE t1;
+End of 6.0 tests
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 24cb725de9f..fd13f53d02b 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -97,30 +97,6 @@ date date_time time_stamp
2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00
2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00
drop table t1;
-create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
-t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
-t14 timestamp(14));
-Warnings:
-Warning 1287 The syntax 'TIMESTAMP(2)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-Warning 1287 The syntax 'TIMESTAMP(4)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-Warning 1287 The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-Warning 1287 The syntax 'TIMESTAMP(8)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-Warning 1287 The syntax 'TIMESTAMP(10)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-Warning 1287 The syntax 'TIMESTAMP(12)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-Warning 1287 The syntax 'TIMESTAMP(14)' is deprecated and will be removed in MySQL 6.0. Please use 'TIMESTAMP' instead
-insert t1 values (0,0,0,0,0,0,0),
-("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
-"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
-"1997-12-31 23:47:59");
-select * from t1;
-t2 t4 t6 t8 t10 t12 t14
-0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
-1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
-select * from t1;
-t2 t4 t6 t8 t10 t12 t14
-0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
-1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
-drop table t1;
create table t1 (ix timestamp);
insert into t1 values (0),(20030101010160),(20030101016001),(20030101240101),(20030132010101),(20031301010101),(20031200000000),(20030000000000);
Warnings:
@@ -436,7 +412,7 @@ max(t)
2004-02-01 00:00:00
drop table t1;
set sql_mode='maxdb';
-create table t1 (a timestamp, b timestamp(19));
+create table t1 (a timestamp, b timestamp);
show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
diff --git a/mysql-test/r/type_varchar.result b/mysql-test/r/type_varchar.result
index 96042a91bae..98ac5973e6d 100644
--- a/mysql-test/r/type_varchar.result
+++ b/mysql-test/r/type_varchar.result
@@ -475,8 +475,9 @@ a (a DIV 2)
60 30
t 0
Warnings:
-Warning 1292 Truncated incorrect INTEGER value: '1a'
-Warning 1292 Truncated incorrect INTEGER value: 't '
+Warning 1292 Truncated incorrect DECIMAL value: '1a'
+Warning 1366 Incorrect decimal value: '' for column '' at row -1
+Warning 1292 Truncated incorrect DECIMAL value: 't '
SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a;
a CAST(a AS SIGNED)
10 10
@@ -489,3 +490,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/udf.result b/mysql-test/r/udf.result
index 601b364fbbe..fbf87b2e4cc 100644
--- a/mysql-test/r/udf.result
+++ b/mysql-test/r/udf.result
@@ -409,3 +409,18 @@ b
1
DROP TABLE t1;
End of 5.0 tests.
+#
+# Bug#33546: Slowdown on re-evaluation of constant expressions.
+#
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES(1),(50);
+CREATE FUNCTION myfunc_double RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
+EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE f1=1 + myfunc_double(1);
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
+Warnings:
+Note 1003 select 1 AS `1` from `test`.`t1` where (`test`.`t1`.`f1` = <cache>((1 + myfunc_double(1 AS `1`))))
+DROP FUNCTION myfunc_double;
+DROP TABLE t1;
+#
+End of 5.1 tests.
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 43d7cade227..71f7547386f 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -153,48 +153,6 @@ ERROR 42S22: Unknown column 'a' in 'field list'
1 3
1 3
2 1
-CREATE TABLE t1 (a INT);
-INSERT INTO t1 VALUES (1);
-SELECT a INTO @v FROM (
-SELECT a FROM t1
-UNION
-SELECT a FROM t1
-) alias;
-SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
-SELECT a FROM t1
-UNION
-SELECT a FROM t1 WHERE 0
-) alias;
-SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM (
-SELECT a FROM t1
-UNION
-SELECT a FROM t1 WHERE 0
-) alias;
-SELECT a FROM (
-SELECT a FROM t1
-UNION
-SELECT a INTO @v FROM t1
-) alias;
-SELECT a FROM (
-SELECT a FROM t1
-UNION
-SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
-) alias;
-SELECT a FROM (
-SELECT a FROM t1
-UNION
-SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1
-) alias;
-SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
-SELECT a FROM t1 UNION SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
-SELECT a FROM t1 UNION SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1;
-SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
-ERROR HY000: Incorrect usage of UNION and INTO
-SELECT a INTO OUTFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
-ERROR HY000: Incorrect usage of UNION and INTO
-SELECT a INTO DUMPFILE '<MYSQLTEST_VARDIR>/tmp/union.out.file' FROM t1 UNION SELECT a FROM t1;
-ERROR HY000: Incorrect usage of UNION and INTO
-DROP TABLE t1;
CREATE TABLE t1 (
`pseudo` char(35) NOT NULL default '',
`pseudo1` char(35) NOT NULL default '',
@@ -1347,6 +1305,8 @@ SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
1048576
SET @@global.max_allowed_packet=25000000;
+Warnings:
+Warning 1292 Truncated incorrect max_allowed_packet value: '25000000'
CREATE TABLE t1 (a mediumtext);
CREATE TABLE t2 (b varchar(20));
INSERT INTO t1 VALUES ('a');
@@ -1588,6 +1548,42 @@ Warnings:
Note 1003 select '0' AS `a` from `test`.`t1` union select '0' AS `a` from `test`.`t1` order by `a`
DROP TABLE t1;
End of 5.0 tests
+#
+# Bug#32858: Error: "Incorrect usage of UNION and INTO" does not take
+# subselects into account
+#
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1);
+# Tests fix in parser rule select_derived_union.
+SELECT a INTO @v FROM (
+SELECT a FROM t1
+UNION
+SELECT a FROM t1
+) alias;
+SELECT a INTO OUTFILE 'union.out.file' FROM (
+SELECT a FROM t1
+UNION
+SELECT a FROM t1 WHERE 0
+) alias;
+SELECT a INTO DUMPFILE 'union.out.file2' FROM (
+SELECT a FROM t1
+UNION
+SELECT a FROM t1 WHERE 0
+) alias;
+SELECT a FROM t1 UNION SELECT a INTO @v FROM t1;
+SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file5' FROM t1;
+SELECT a FROM t1 UNION SELECT a INTO OUTFILE 'union.out.file6' FROM t1;
+SELECT a INTO @v FROM t1 UNION SELECT a FROM t1;
+ERROR HY000: Incorrect usage of UNION and INTO
+SELECT a INTO OUTFILE 'union.out.file7' FROM t1 UNION SELECT a FROM t1;
+ERROR HY000: Incorrect usage of UNION and INTO
+SELECT a INTO DUMPFILE 'union.out.file8' FROM t1 UNION SELECT a FROM t1;
+ERROR HY000: Incorrect usage of UNION and INTO
+# Tests fix in parser rule query_expression_body.
+SELECT ( SELECT a UNION SELECT a ) INTO @v FROM t1;
+SELECT ( SELECT a UNION SELECT a ) INTO OUTFILE 'union.out.file3' FROM t1;
+SELECT ( SELECT a UNION SELECT a ) INTO DUMPFILE 'union.out.file4' FROM t1;
+DROP TABLE t1;
#
# Bug #49734: Crash on EXPLAIN EXTENDED UNION ... ORDER BY
# <any non-const-function>
diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result
index a94eb4616d1..80ec5517b16 100644
--- a/mysql-test/r/user_limits.result
+++ b/mysql-test/r/user_limits.result
@@ -70,7 +70,7 @@ select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
0 0
set session max_user_connections= 2;
-ERROR HY000: Variable 'max_user_connections' is a GLOBAL variable and should be set with SET GLOBAL
+ERROR HY000: SESSION variable 'max_user_connections' is read-only. Use SET GLOBAL to assign the value
set global max_user_connections= 2;
select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result
index 05efea79fe7..251d0b39098 100644
--- a/mysql-test/r/user_var-binlog.result
+++ b/mysql-test/r/user_var-binlog.result
@@ -8,34 +8,50 @@ SET @var2=char(ascii('a'));
insert into t1 values (@var1),(@var2);
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # BEGIN
master-bin.000001 # User var # # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@`a b`)
+master-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # BEGIN
master-bin.000001 # User var # # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci
master-bin.000001 # User var # # @`var2`=_binary 0x61 COLLATE binary
master-bin.000001 # Query # # use `test`; insert into t1 values (@var1),(@var2)
+master-bin.000001 # Query # # COMMIT
flush logs;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
ROLLBACK/*!*/;
-SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;
-use test/*!*/;
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
-SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
+SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=0/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
+BEGIN
+/*!*/;
+SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;
+use test/*!*/;
+SET TIMESTAMP=10000/*!*/;
INSERT INTO t1 VALUES(@`a b`)
/*!*/;
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
+SET TIMESTAMP=10000/*!*/;
+BEGIN
+/*!*/;
SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`/*!*/;
SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/;
SET TIMESTAMP=10000/*!*/;
insert into t1 values (@var1),(@var2)
/*!*/;
+SET TIMESTAMP=10000/*!*/;
+COMMIT
+/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result
index be10bd9954b..c73d2e64540 100644
--- a/mysql-test/r/user_var.result
+++ b/mysql-test/r/user_var.result
@@ -192,8 +192,6 @@ coercibility(@v1) coercibility(@v2) coercibility(@v3) coercibility(@v4)
2 2 2 2
set session @honk=99;
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 '@honk=99' at line 1
-set one_shot @honk=99;
-ERROR HY000: The 'SET ONE_SHOT' syntax is reserved for purposes internal to the MySQL server
select @@local.max_allowed_packet;
@@local.max_allowed_packet
#
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 541b2b2fb86..a8737419aa1 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -24,7 +24,7 @@ set @my_query_cache_type =@@global.query_cache_type;
set @my_rpl_recovery_rank =@@global.rpl_recovery_rank;
set @my_server_id =@@global.server_id;
set @my_slow_launch_time =@@global.slow_launch_time;
-set @my_storage_engine =@@global.storage_engine;
+set @my_storage_engine =@@global.default_storage_engine;
set @my_thread_cache_size =@@global.thread_cache_size;
set @my_max_allowed_packet =@@global.max_allowed_packet;
set @my_join_buffer_size =@@global.join_buffer_size;
@@ -57,7 +57,7 @@ select @`select`,@not_used;
set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL;
select @test_int,@test_double,@test_string,@test_string2,@select;
@test_int @test_double @test_string @test_string2 @select
-10 1e-10 abcdeghi abcdefghij NULL
+10 0.0000000001 abcdeghi abcdefghij NULL
set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello";
select @test_int,@test_double,@test_string,@test_string2;
@test_int @test_double @test_string @test_string2
@@ -165,28 +165,28 @@ set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF",
set global concurrent_insert=2;
show variables like 'concurrent_insert';
Variable_name Value
-concurrent_insert 2
+concurrent_insert ALWAYS
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
VARIABLE_NAME VARIABLE_VALUE
-CONCURRENT_INSERT 2
+CONCURRENT_INSERT ALWAYS
set global concurrent_insert=1;
show variables like 'concurrent_insert';
Variable_name Value
-concurrent_insert 1
+concurrent_insert AUTO
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
VARIABLE_NAME VARIABLE_VALUE
-CONCURRENT_INSERT 1
+CONCURRENT_INSERT AUTO
set global concurrent_insert=0;
show variables like 'concurrent_insert';
Variable_name Value
-concurrent_insert 0
+concurrent_insert NEVER
select * from information_schema.session_variables where variable_name like 'concurrent_insert';
VARIABLE_NAME VARIABLE_VALUE
-CONCURRENT_INSERT 0
+CONCURRENT_INSERT NEVER
set global concurrent_insert=DEFAULT;
select @@concurrent_insert;
@@concurrent_insert
-1
+AUTO
set global timed_mutexes=ON;
show variables like 'timed_mutexes';
Variable_name Value
@@ -201,21 +201,23 @@ timed_mutexes OFF
select * from information_schema.session_variables where variable_name like 'timed_mutexes';
VARIABLE_NAME VARIABLE_VALUE
TIMED_MUTEXES OFF
-set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE";
-show local variables like 'storage_engine';
+set default_storage_engine=MYISAM, default_storage_engine="HEAP", global default_storage_engine="MERGE";
+show local variables like 'default_storage_engine';
Variable_name Value
-storage_engine MEMORY
-select * from information_schema.session_variables where variable_name like 'storage_engine';
+default_storage_engine MEMORY
+select * from information_schema.session_variables where variable_name like 'default_storage_engine';
VARIABLE_NAME VARIABLE_VALUE
-STORAGE_ENGINE MEMORY
-show global variables like 'storage_engine';
+DEFAULT_STORAGE_ENGINE MEMORY
+show global variables like 'default_storage_engine';
Variable_name Value
-storage_engine MRG_MYISAM
-select * from information_schema.global_variables where variable_name like 'storage_engine';
+default_storage_engine MRG_MYISAM
+select * from information_schema.global_variables where variable_name like 'default_storage_engine';
VARIABLE_NAME VARIABLE_VALUE
-STORAGE_ENGINE MRG_MYISAM
-set GLOBAL query_cache_size=100000;
+DEFAULT_STORAGE_ENGINE MRG_MYISAM
+set GLOBAL query_cache_size=102400;
set GLOBAL myisam_max_sort_file_size=2000000;
+Warnings:
+Warning 1292 Truncated incorrect myisam_max_sort_file_size value: '2000000'
show global variables like 'myisam_max_sort_file_size';
Variable_name Value
myisam_max_sort_file_size 1048576
@@ -256,6 +258,8 @@ NET_READ_TIMEOUT 30
NET_RETRY_COUNT 10
NET_WRITE_TIMEOUT 60
set global net_buffer_length=8000, global net_read_timeout=900, net_write_timeout=1000;
+Warnings:
+Warning 1292 Truncated incorrect net_buffer_length value: '8000'
show global variables like 'net_%';
Variable_name Value
net_buffer_length 7168
@@ -359,13 +363,20 @@ TRANSACTION_PREALLOC_SIZE 19456
==+ Manipulate variable values +==
Testing values that are not 1024 multiples
set @@range_alloc_block_size=1024*16+1023;
+Warnings:
+Warning 1292 Truncated incorrect range_alloc_block_size value: '17407'
set @@query_alloc_block_size=1024*17+2;
+Warnings:
+Warning 1292 Truncated incorrect query_alloc_block_size value: '17410'
set @@query_prealloc_size=1024*18-1023;
+Warnings:
+Warning 1292 Truncated incorrect query_prealloc_size value: '17409'
set @@transaction_alloc_block_size=1024*20-1;
+Warnings:
+Warning 1292 Truncated incorrect transaction_alloc_block_size value: '20479'
set @@transaction_prealloc_size=1024*21-1;
-select @@query_alloc_block_size;
-@@query_alloc_block_size
-17408
+Warnings:
+Warning 1292 Truncated incorrect transaction_prealloc_size value: '21503'
==+ Check manipulated values ==+
SHOW VARIABLES WHERE variable_name IN ('range_alloc_block_size',
'query_alloc_block_size', 'query_prealloc_size',
@@ -415,17 +426,15 @@ set unknown_variable=1;
ERROR HY000: Unknown system variable 'unknown_variable'
set max_join_size="hello";
ERROR 42000: Incorrect argument type to variable 'max_join_size'
-set storage_engine=UNKNOWN_TABLE_TYPE;
-ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE'
-set storage_engine=MERGE, big_tables=2;
+set default_storage_engine=UNKNOWN_TABLE_TYPE;
+ERROR 42000: Unknown storage engine 'UNKNOWN_TABLE_TYPE'
+set default_storage_engine=MERGE, big_tables=2;
ERROR 42000: Variable 'big_tables' can't be set to the value of '2'
-show local variables like 'storage_engine';
+show local variables like 'default_storage_engine';
Variable_name Value
-storage_engine MEMORY
+default_storage_engine MEMORY
set SESSION query_cache_size=10000;
ERROR HY000: Variable 'query_cache_size' is a GLOBAL variable and should be set with SET GLOBAL
-set GLOBAL storage_engine=DEFAULT;
-ERROR 42000: Variable 'storage_engine' doesn't have a default value
set character_set_client=UNKNOWN_CHARACTER_SET;
ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET'
set collation_connection=UNKNOWN_COLLATION;
@@ -434,18 +443,12 @@ set character_set_client=NULL;
ERROR 42000: Variable 'character_set_client' can't be set to the value of 'NULL'
set collation_connection=NULL;
ERROR 42000: Variable 'collation_connection' can't be set to the value of 'NULL'
-set global autocommit=1;
-ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL
select @@global.timestamp;
ERROR HY000: Variable 'timestamp' is a SESSION variable
set @@version='';
ERROR HY000: Variable 'version' is a read only variable
set @@concurrent_insert=1;
ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
-set @@global.sql_auto_is_null=1;
-ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable and can't be used with SET GLOBAL
-select @@global.sql_auto_is_null;
-ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable
set myisam_max_sort_file_size=100;
ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
set @@SQL_WARNINGS=NULL;
@@ -530,14 +533,16 @@ set net_read_timeout=100;
set net_write_timeout=100;
set global query_cache_limit=100;
set global query_cache_size=100;
+Warnings:
+Warning 1292 Truncated incorrect query_cache_size value: '100'
set global query_cache_type=demand;
set read_buffer_size=100;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '100'
set read_rnd_buffer_size=100;
-Warnings:
-Warning 1292 Truncated incorrect read_rnd_buffer_size value: '100'
set global rpl_recovery_rank=100;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
set global server_id=100;
set global slow_launch_time=100;
set sort_buffer_size=100;
@@ -568,17 +573,13 @@ set sql_log_update=1;
Warnings:
Note 1315 The update log is deprecated and replaced by the binary log; SET SQL_LOG_UPDATE has been ignored
set sql_low_priority_updates=1;
-set sql_max_join_size=200;
-select @@sql_max_join_size,@@max_join_size;
-@@sql_max_join_size @@max_join_size
-200 200
set sql_quote_show_create=1;
set sql_safe_updates=1;
set sql_select_limit=1;
set sql_select_limit=default;
set sql_warnings=1;
set global table_open_cache=100;
-set storage_engine=myisam;
+set default_storage_engine=myisam;
set global thread_cache_size=100;
set timestamp=1, timestamp=default;
set tmp_table_size=100;
@@ -615,6 +616,8 @@ create table t2 (a int not null auto_increment, primary key(a));
insert into t1 values(null),(null),(null);
insert into t2 values(null),(null),(null);
set global key_buffer_size=100000;
+Warnings:
+Warning 1292 Truncated incorrect key_buffer_size value: '100000'
select @@key_buffer_size;
@@key_buffer_size
98304
@@ -658,11 +661,11 @@ MYISAM_MAX_SORT_FILE_SIZE MAX_FILE_SIZE
set global myisam_max_sort_file_size=default;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
-100 200
+100 100
set @svc=@@global.max_user_connections, @svj=@@local.max_join_size;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
-100 200
+100 100
set @@global.max_user_connections=111,@@local.max_join_size=222;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
@@ -674,7 +677,7 @@ select @@global.max_user_connections,@@local.max_join_size;
set @@global.max_user_connections=@svc, @@local.max_join_size=@svj;
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@local.max_join_size
-100 200
+100 100
set @a=1, @b=2;
set @a=@b, @b=@a;
select @a, @b;
@@ -812,16 +815,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 +867,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;
@@ -1055,9 +1058,11 @@ set global net_read_timeout =@my_net_read_timeout;
set global query_cache_limit =@my_query_cache_limit;
set global query_cache_type =@my_query_cache_type;
set global rpl_recovery_rank =@my_rpl_recovery_rank;
+Warnings:
+Warning 1287 The syntax '@@rpl_recovery_rank' is deprecated and will be removed in MySQL 7.0.
set global server_id =@my_server_id;
set global slow_launch_time =@my_slow_launch_time;
-set global storage_engine =@my_storage_engine;
+set global default_storage_engine =@my_storage_engine;
set global thread_cache_size =@my_thread_cache_size;
set global max_allowed_packet =@my_max_allowed_packet;
set global join_buffer_size =@my_join_buffer_size;
@@ -1182,18 +1187,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
@@ -1440,10 +1445,10 @@ Warning 1292 Truncated incorrect auto_increment_offset value: '-1'
SET GLOBAL auto_increment_offset=0;
Warnings:
Warning 1292 Truncated incorrect auto_increment_offset value: '0'
-select @@storage_engine;
+select @@default_storage_engine;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
-def @@storage_engine 253 6 6 Y 0 31 8
-@@storage_engine
+def @@default_storage_engine 253 6 6 Y 0 31 8
+@@default_storage_engine
MyISAM
SET @old_server_id = @@GLOBAL.server_id;
SET GLOBAL server_id = (1 << 32) - 1;
@@ -1494,3 +1499,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 613939bfdf6..a54db7240a4 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1104,6 +1104,9 @@ select * from t2;
ERROR HY000: Table 't2' was not locked with LOCK TABLES
drop view v1;
drop table t1, t2;
+ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+unlock tables;
+drop table t1, t2;
create table t1 (a int);
create view v1 as select * from t1 where a < 2 with check option;
insert into v1 values(1);
@@ -1111,8 +1114,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 +1128,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 +1151,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 +1185,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 +1286,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 +1331,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 +1357,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 +2345,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
@@ -2587,7 +2590,7 @@ CREATE VIEW v1 AS SELECT SQRT(a) my_sqrt FROM t1;
SELECT my_sqrt FROM v1 ORDER BY my_sqrt;
my_sqrt
1
-1.4142135623731
+1.4142135623730951
DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (id int PRIMARY KEY);
@@ -3699,6 +3702,117 @@ SELECT * FROM v1 IGNORE INDEX (c2) WHERE c2=2;
ERROR 42000: Key 'c2' doesn't exist in table 'v1'
DROP VIEW v1;
DROP TABLE t1;
+#
+# Bug #45806 crash when replacing into a view with a join!
+#
+CREATE TABLE t1(a INT UNIQUE);
+CREATE VIEW v1 AS SELECT t1.a FROM t1, t1 AS a;
+INSERT INTO t1 VALUES (1), (2);
+REPLACE INTO v1(a) SELECT 1 FROM t1,t1 AS c;
+SELECT * FROM v1;
+a
+1
+2
+1
+2
+REPLACE INTO v1(a) SELECT 3 FROM t1,t1 AS c;
+SELECT * FROM v1;
+a
+1
+2
+3
+1
+2
+3
+1
+2
+3
+DELETE FROM t1 WHERE a=3;
+INSERT INTO v1(a) SELECT 1 FROM t1,t1 AS c
+ON DUPLICATE KEY UPDATE `v1`.`a`= 1;
+SELECT * FROM v1;
+a
+1
+2
+1
+2
+CREATE VIEW v2 AS SELECT t1.a FROM t1, v1 AS a;
+REPLACE INTO v2(a) SELECT 1 FROM t1,t1 AS c;
+SELECT * FROM v2;
+a
+1
+2
+1
+2
+1
+2
+1
+2
+REPLACE INTO v2(a) SELECT 3 FROM t1,t1 AS c;
+SELECT * FROM v2;
+a
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+INSERT INTO v2(a) SELECT 1 FROM t1,t1 AS c
+ON DUPLICATE KEY UPDATE `v2`.`a`= 1;
+SELECT * FROM v2;
+a
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+1
+2
+3
+DROP VIEW v1;
+DROP VIEW v2;
+DROP TABLE t1;
+# -- End of test case for Bug#45806
# -----------------------------------------------------------------
# -- Bug#40825: Error 1356 while selecting from a view
# -- with a "HAVING" clause though query works
@@ -3847,3 +3961,16 @@ DROP TABLE t1;
# -----------------------------------------------------------------
# -- End of 5.1 tests.
# -----------------------------------------------------------------
+drop table if exists t_9801;
+drop view if exists v_9801;
+create table t_9801 (s1 int);
+create view v_9801 as
+select sum(s1) from t_9801 with check option;
+ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801'
+create view v_9801 as
+select sum(s1) from t_9801 group by s1 with check option;
+ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801'
+create view v_9801 as
+select sum(s1) from t_9801 group by s1 with rollup with check option;
+ERROR HY000: CHECK OPTION on non-updatable view 'test.v_9801'
+drop table t_9801;
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..8e70ea8b53d 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;
@@ -166,9 +166,6 @@ show variables like 'max_error_count';
Variable_name Value
max_error_count 10
drop table t1;
-set table_type=MYISAM;
-Warnings:
-Warning 1287 The syntax '@@table_type' is deprecated and will be removed in MySQL 6.0. Please use '@@storage_engine' instead
create table t1 (a int);
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
update t1 set a='abc';
diff --git a/mysql-test/r/warnings_engine_disabled.result b/mysql-test/r/warnings_engine_disabled.result
index e5d35fdaa5f..3b9d92d87f7 100644
--- a/mysql-test/r/warnings_engine_disabled.result
+++ b/mysql-test/r/warnings_engine_disabled.result
@@ -1,10 +1,10 @@
create table t1 (id int) engine=NDB;
Warnings:
-Warning 1286 Unknown table engine 'NDB'
+Warning 1286 Unknown storage engine 'NDB'
Warning 1266 Using storage engine MyISAM for table 't1'
alter table t1 engine=NDB;
Warnings:
-Warning 1286 Unknown table engine 'NDB'
+Warning 1286 Unknown storage engine 'NDB'
drop table t1;
SELECT ENGINE, SUPPORT FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='ndbcluster';
ENGINE SUPPORT